我想在jQuery中使用imgareaselect [英] I want to use imgareaselect in jquery

查看:100
本文介绍了我想在jQuery中使用imgareaselect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是jquery的新手,我的新任务是"jquery中的imgareaselect". 我指的是. 但我缺少了解逻辑的地方. 请帮助我创建"imgareaselect"

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"

现在我的要求是:

<!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>

推荐答案

带有JAVASCRIPT的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>
</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.

这篇关于我想在jQuery中使用imgareaselect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆