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

How do I run livequery on this append?

I've http://fancybox.net on my image, trying to execute it for appended html.

James
  • 42,081
  • 53
  • 136
  • 161

2 Answers2

1

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();
atp
  • 30,132
  • 47
  • 125
  • 187
1

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

Community
  • 1
  • 1
CronosS
  • 3,129
  • 3
  • 21
  • 28