Small resolution image not zooming
mrunali24 opened this issue · 1 comments
mrunali24 commented
I have an e-commerce application in which images are uploaded by end user so I don't have control in changing the size of images. I am using elevatezoom plugin. Those whose images are small are not able to zoom. Kindly provide solution for this.
I am using jQuery elevateZoom 3.0.8 version
SkyHolder commented
function initZoom(img) {
destroyZoom(img);
if (img[0].naturalWidth > img.width()) {
img.parent().addClass('allow_zoom');
img.elevateZoom({
zoomType: "inner",
easing: true,
});
}
}
function destroyZoom(img) {
img.parent().removeClass('allow_zoom');
$('.zoomContainer').remove();
$('.zoomImage').removeData('elevateZoom');
$('.zoomImage').removeData('zoomImage');
}