jquery - (Solved) Not work jqZoom in colorbox -
i want enable jqzoom ajax colorbox popup, not open.
code:
/*colorbox*/ $('.colorbox1').colorbox({ overlayclose: true, opacity: 0.5, rel: "colorbox" }); /*jqzoom*/ $('.jqzoom').jqzoom({ zoomtype: 'standard', lens:true, preloadimages: false, alwayson:false, zoomwidth: 250, zoomheight: 250 });
i found answer it.
reason why not working: jqzoom render before image load colorbox popup, jqzoom not able count exact dimension (width x height) of image.
i got solution below 2 solution
solution 1: render/call jqzoom after timeout in colorbox popup
settimeout(function(){ $('.jqzoom').jqzoom({ zoomtype: 'standard', lens:true, preloadimages: false, alwayson:false, zoomwidth: 250, zoomheight: 250 }); }, 1000); solution 2: call jqzoom after colorbox render
$('.colorbox1').colorbox({ overlayclose: true, opacity: 0.5, rel: "colorbox", oncomplete: function(){ $('.jqzoom').jqzoom({ zoomtype: 'standard', lens:true, preloadimages: false, alwayson:false, zoomwidth: 250, zoomheight: 250 }); } });
Comments
Post a Comment