igorlino / elevatezoom-plus

Enhanced elevateZoom - A jQuery image zoom plugin
http://igorlino.github.io/elevatezoom-plus/
MIT License
162 stars 78 forks source link

Unable to destroy instance #84

Open infobahn opened 7 years ago

infobahn commented 7 years ago

I have a gallery of images and I'm trying to destroy my elevatezoom instance so I can change the main image and open a new one. I'm using the following code:

plugin = $('.main-image').data('ezPlus');

if (plugin) {
        plugin.showHideZoomContainer(action);
        plugin.showHideWindow(action);
        plugin.showHideTint(action);
        plugin.showHideLens(action);
        plugin.destroy;
}

But I get the following error:

Uncaught TypeError: plugin.destroy is not a function

I might be being stupid, but I can't work out what I'm doing wrong!

bcase10 commented 7 years ago

I'm having the same problem. Has anyone found a solution?

lastobelus commented 7 years ago

Is the code getting called twice? ezPlus destroy does not turn off data('ezPlus') (I think it should)