开发者

Dynamically starting a zoom script with jquery

开发者 https://www.devze.com 2023-02-17 13:45 出处:网络
I don\'t know how to dynamically start the jQuery Image Power Zoomer v1.1 script from Dynamicdrive. I would need to start the zoom on lightbox-type gallery images, but when 开发者_运维百科I call it w

I don't know how to dynamically start the jQuery Image Power Zoomer v1.1 script from Dynamicdrive. I would need to start the zoom on lightbox-type gallery images, but when 开发者_运维百科I call it with click (live) it needs the cursor to be moved out from the picture and back in to get the script started. My preferred method would be the simple mouseenter method, but it seems to be conflicting with the scripts' own mouseenter-mouseleave actions, so I could make the compromise with the click if it's necessary.

The example page is here: http://baksagaspar.com/MH-work/collections/jungle-under-construction-2

and I use this script for triggering:

jQuery("img#shTopImg").live('click', function() {
jQuery("img#shTopImg").addpowerzoom( { magnifiersize: [200,200] } );
}); 

Any help please, how could I get the script start dynamically?


You need to call init event on page loading:

jQuery(document).ready(function () {
   $('a.shutterset_set_1 img').addpowerzoom( { magnifiersize: [200,200] } );
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号