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();
精彩评论