$(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>
Enlacé la imagen de clic de jquery: error en el complemento js zoom. ¿Cuál es el problema con este código? Muestra un error en vscode que muestra '{' esperado. ¿Puede alguien ayudarme, por favor?
El error se produce en la línea $(this).imageZoom
. Sin embargo, no debería necesitar esta línea porque ya está llamando a $('.my-gallery').imageZoom
. Simplemente pase los parámetros de Zoom
Por ejemplo:
$(function () { $('.my-gallery').imageZoom({ zoom: 200 }); });