问题描述:

I've a Gallery where i've enable elevateZoom. This Elevate is enable outside the gallery as well. How to hide the elevate zoom outside gallery. Below is a simple code what am using. I tried using mouseleave but that doesn't seem to work.

(function($){

$(document).ready(function () {

$('.rg-image-wrapper').mouseleave(function(){

$('.zoomContainer').hide();

});

$('#zoombtn').on('click', function(){

if( $('.enabled').length === 0){

$('.zoomContainer').show();

$("#zooom").elevateZoom({

zoomType: "lens",

lensShape : "square",

cursor: "crosshair"

});

$(this).toggleClass('enabled');

}

else{

$(this).toggleClass('enabled');

$('.zoomContainer').hide();

}

});

});

})(jQuery);

ScreenShots of elevateZoom coming out of frame.

网友答案:

Update: you want image constraint if I understand you correctly.

DEMO

$("#zoom_01").elevateZoom({constrainType:"height", constrainSize:274, zoomType: "lens", containLensZoom: true, gallery:'gallery_01', cursor: 'pointer', galleryActiveClass: "active"}); 

相关阅读:
Top