开发者

jQuery - Shadowbox rebinding

开发者 https://www.devze.com 2022-12-24 08:50 出处:网络
How do I bind / initialize Shadowbox to content loaded by jQuery using AJAX? Right now shadowbox works when I first come into the site.

How do I bind / initialize Shadowbox to content loaded by jQuery using AJAX?

Right now shadowbox works when I first come into the site.

However, when I swap the content with a new one loaded through AJAX, these new batch of content doesn't do the shado开发者_JAVA技巧wbox popup, instead it just redirect to the content.

I have Shadowbox.init(shadowbox_conf); in the success but it doesn't seem to do the trick.

Thanks,

Tee


Ah I just found the solution.

Shadowbox.init can't be called 2 times.

So use this instead.
Shadowbox.setup();

Thanks,
Tee


Actually, i personally had to do:

        Shadowbox.clearCache();
        Shadowbox.setup();

to get shadowbox to acknowledge the DOM change.

0

精彩评论

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

关注公众号