-1

私はjqueryが初めてで、私の新しいタスクは「jqueryのimgareaselect」です。私はこれを参照しています。しかし、私は論理を理解するためのどこかが欠けています。「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>
4

1 に答える 1

0

HTML と 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>
...

それを試して、fiddleで実験してください。ドキュメントを読むと、制限がわかります。

于 2013-12-12T07:12:29.477 に答える