【发布时间】:2021-11-18 06:48:54
【问题描述】:
$(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 class="slider-for m-2" class="my-gallery">
<img src="{% static 'images/product1.png' %}" width="80" class="gallery-image">
<img src="{% static 'images/product2.png' %}" width="80" class="gallery-image">
<img src="{% static 'images/product3.png' %}" width="80" class="gallery-image">
<img src="{% static 'images/product4.png' %}" width="80" class="gallery-image">
<img src="{% static 'images/product5.png' %}" width="80" class="gallery-image">
<img src="{% static 'images/product3.png' %}" width="80" class="gallery-image">
</div>
我链接了 jquery click-image-Error in jszoom 插件。这段代码有什么问题.. 它在 vscode 中显示错误,显示“{”预期有人可以帮忙吗?
【问题讨论】:
-
这是有效的 JQuery 语法。因此,问题很可能出在其他地方。你能提供更多代码吗?
$(document).ready(function(){&$(function(){也做同样的事情。我建议删除其中一行并关闭}); -
我删除了 $(document).ready 行..仍然显示错误。我附上了上面的错误图片截图链接。
标签: javascript jquery jquery-ui jquery-plugins jquery-hover