I want to use imgareaselect in jquery [closed]

為{幸葍}努か 提交于 2019-12-24 19:27:13

问题


I m new in jquery.and my new task is "imgareaselect in jquery". I am refering THIS. but i am lacking somewhere to understand the logic. pls help me to create "imgareaselect"

Now my coading is:

<!DOCTYPE html>
  <html>
    <head>
     <script src="http://odyniec.net/projects/imgareaselect/jquery.imgareaselect.pack.js">     </script>
      <script src="http://odyniec.net/projects/imgareaselect/css/imgareaselect-animated.css"></script>
      <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    </head>
    <body>
      <img id="photo" src="https://www.google.com/images/srpr/logo11w.png" />
        <script>
          $('img#photo').imgAreaSelect({
            handles: true,
            onSelectEnd: function (img, selection) {
             alert('width: ' + selection.width + '; height: ' + selection.height);
           }
         });
        </script>
      </body>
   </html>

回答1:


HTML w/ JAVASCRIPT

...
<head>
<script src="http://odyniec.net/projects/imgareaselect/jquery.imgareaselect.pack.js"></script>
<script src="http://odyniec.net/projects/imgareaselect/css/imgareaselect-animated.css"></script>
</head>

<body>

    <img id="photo" src="https://www.google.com/images/srpr/logo11w.png" />

    <script>
    $('img#photo').imgAreaSelect({
        handles: true,
        onSelectEnd: function (img, selection) {
            alert('width: ' + selection.width + '; height: ' + selection.height);
        }
    });
    </script>

</body>
...

Try it out and experiment on fiddle. Read the documentation and you can see the limitations.



来源:https://stackoverflow.com/questions/20536441/i-want-to-use-imgareaselect-in-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!