Вопрос

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.

Это было полезно?

Решение

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();
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top