$(document).ready(function(){
$(function(){
$('.my-gallery').imageZoom({
$(this).imageZoom({
zoom: 200
});
});
});
});
HTML:
<link rel="stylesheet"href="{% static 'click-tap-image/dist/css/image-zoom.css' %}" />
<script src="{% static 'click-tap-image/dist/js/image-zoom.min.js' %}"></script>
<div >
<img src="{% static 'images/product1.png' %}" width="80" >
<img src="{% static 'images/product2.png' %}" width="80" >
<img src="{% static 'images/product3.png' %}" width="80" >
<img src="{% static 'images/product4.png' %}" width="80" >
<img src="{% static 'images/product5.png' %}" width="80" >
<img src="{% static 'images/product3.png' %}" width="80" >
</div>
我鏈接了 jquery click-image- js縮放插件中的錯誤。這段代碼有什么問題..它在 vscode 中顯示錯誤,顯示“{”預期有人可以請幫忙嗎?
uj5u.com熱心網友回復:
該錯誤是在線引起的$(this).imageZoom。但是,您應該不需要此行,因為您已經在呼叫$('.my-gallery').imageZoom. 只需傳入縮放引數
例如:
$(function () {
$('.my-gallery').imageZoom({
zoom: 200
});
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/430909.html
標籤:javascript jQuery jQuery-ui jquery 插件 jquery-悬停
