I use jQuery Colorbox which works well like so:
$(function(){
$("a.slideshow").colorbox();
});
Now, if after page load, I add a new node (matching a.slideshow
), (created or ajax'ed), then of course it does not work untile I call .colorbox()
again.
I have looked around and seen the difficulty with doing this kind of thing generally. (e.g. Is there a JavaScript/jQuery DOM change listener?, http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMSubtreeModified)
So, just in case there's a special solution for Colorbox, I am formally asking the question.
Can't you re-initialise the colorbox at the point of dynamically adding a new element?
So,