2013-12-12 37 views
0

我是新來的jquery.and我的新任務是「imgareaselect在jquery中」。 我指的是THIS。 但我缺乏理解邏輯的地方。 請幫我現在我coading是打造 「imgareaselect」我想在jquery中使用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> 
+0

歡迎來到SO。任何代碼?你嘗試過什麼嗎? – Vishwas

+0

其實我不能爲這個準備html代碼... 1:下載插件然後2:在頭部分的鏈接。 3:腳本功能。現在?..... – sonalgoyal

+0

您是否閱讀過文檔?這非常簡單,但是要在輸入框中加載數據需要更多的工作。 –

回答

1

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。閱讀文檔,您可以看到限制。

+0

我編輯我的問題,請查看它。 – sonalgoyal