How to change data-zoom-image value

前端 未结 7 2256
旧时难觅i
旧时难觅i 2021-01-04 11:03

I\'m using elevate zoom effects for zooming facility of image, my image tag is:



        
7条回答
  •  别那么骄傲
    2021-01-04 11:43

    I was having exactly the same problem here, figured it out: it probably doesn't work because the plugin doesn't support changing that particular attribute - it has its own gallery functionality. There are errors in their own documentation, this is how it works:

    HTML for main image & thumbnails:

    
    
    
    

    jQuery for initializing the gallery:

    $("#bigpic").elevateZoom({
    gallery:'gal1',
    galleryActiveClass: 'active'
    
    • plus whatever other attributes you want to give it

    jQuery for passing the images to the main container:

    $("#bigpic").bind("click", function(e) {  
    var ez =   $('#bigpic').data('elevateZoom');    
    $.fancybox(ez.getGalleryList());
    return false;
    });
    

    I'm new to jQuery and I don't really 100% understand the mechanics here, but that's how I got it to work, I hope it works for you!

提交回复
热议问题