开发者

jQuery append html

jQuery('.block').append(html);

How do I run livequery on this append?

I've ht开发者_如何学JAVAtp://fancybox.net on my image, trying to execute it for appended html.


You can do this, to aim your images :

$('.block').find('#myImages img').fancybox();

If that doesn't work, you can look the accepted answer here : Fancybox, getting Fancybox to bind using LIVE() to items being loaded onto the page after load


Let's say you did this on page load:

$('#myImages').fancybox();

And doing the following appended more #myImages:

$('.block').append(html);

Then you can bind .fancybox() to just those elements:

$('.block').find('#myImages').fancybox();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜