I have a gallery made with lightbox 2 made in a normal matter with thumbnails etc. Now I need to add some HTML via JS into a div of lightbox 2. How do I do that?
First I thought, just do a function and call it with onclick, but lightbox isn't ready then, so I have to wait for it to be ready, how do I do that? Lightbox uses the prototype framework. Is it possible in this way, something like a listener?
Thanks :)
Lightbox2 doesn't have any public event for that. Your best bet is to use a script that has public events that you can subscribe to. I would recommend either Fancybox or Colorbox.
With Fancybox you would just need to add the code inside the onComplete
function that is called when the Fancybox is finished opening.
Note that both of these use jQuery, but that shouldn't be a problem as long as you use noConflict().