elevateweb / elevatezoom

1.02k stars 493 forks source link

Small resolution image not zooming #179

Open mrunali24 opened 6 years ago

mrunali24 commented 6 years ago

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

app.txt description.txt

SkyHolder commented 5 years ago
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');
}