Use jQuery Fancybox(lightbox type dialog) with dynamically loaded links

Posted by Pjack on Stack Overflow See other posts from Stack Overflow or by Pjack
Published on 2010-05-05T16:34:01Z Indexed on 2010/05/11 16:24 UTC
Read the original article Hit count: 328

I'm trying to bind Fancy box links so that when the new links are created it will still work. I've seen a few other question on here but not really answered. This is what I'm trying to do.

jQuery("a#[id^='domore_']").fancybox({
'autoDimensions' : false,
'width'           : 'auto',
'height'          : 'auto'
});

This works fine but when the page or links are reloaded by ajax it doesn't work. I tried using live() but I couldn't get it to work. How do you rebind or implement live on fancybox? Any way to do this? Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about fancybox