Once the page load, code is working fine, after trying to change the set of images through ajax within same div, without refreshing the page, then zoom is not working
I assigned a variable and set the zoom, then disable the zoom using destroy method, then again enabled the zoom..
$(function(){
var zoom;
zoom = $(".rtwpvg-wrapper").find("img").magnify();
$(".swatchinput").each(function(){
$(this).click(function(){
zoom.destroy();
$(".rtwpvg-wrapper").find("img").magnify();
});
});
});
zoom Images should work even after replacing the images within same div