shadowbox stops working after jquery function call

前端 未结 3 1290
花落未央
花落未央 2020-12-19 04:36

I have a shadowbox script. When I load the page everything works fine, but when I call this jquery load function and then try to trigger the shadowbox by clicking on the ima

3条回答
  •  感动是毒
    2020-12-19 05:17

    Well, based on Shem's answer, this is my solution. Every click on specific class, setup and open shadowbox with elements from same class:

    jQuery('.sb-gallery a').live('click',function(e){
        Shadowbox.setup(jQuery('.sb-gallery a'));
        Shadowbox.open(this);
        //Stops loading link
        e.preventDefault();
    });
    

    Thanks to all

提交回复
热议问题