Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small resolution image not zooming #179

Open
mrunali24 opened this issue Jul 20, 2018 · 1 comment
Open

Small resolution image not zooming #179

mrunali24 opened this issue Jul 20, 2018 · 1 comment

Comments

@mrunali24
Copy link

mrunali24 commented Jul 20, 2018

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
Copy link

SkyHolder commented Aug 9, 2019

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');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants