elevateZoom disable hidden elements

后端 未结 3 570
无人及你
无人及你 2021-01-15 04:24

I\'m using elevateZoom.js for preview image. And I have a problem with hidden elements in slider. How to disable preview overflow-hidden pictures on hover. In thisexample, a

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-15 04:39

    Try following this: it may easy for you

    $('#primaryImage').click(function(){
       if($(window).width()>768){
            $(this).elevateZoom({
                zoomWindowPosition:1,
                zoomWindowOffetx: 5,
                zoomWindowWidth:$(this).width(), 
                zoomWindowHeight:$(this).height(),
            }); 
        }
        else{
            $.removeData($(this), 'elevateZoom');//remove zoom instance from image
            $('.zoomContainer').remove(); // remove zoom container from DOM
            return false;
        }
    });
    

提交回复
热议问题