I'm trying to use jquery lightbox to display photos that are loaded into a page using load(). My code is:
$('#content').on('click', 'a.thumb_link', function(){
$('a.thumb_link').lightBox();
return false;
});
This works only if I click the link twice.
I'm baffled, why the 2 provided answers didn't work?
At the end, I managed to get it working by including my JS inside the loaded page, so that the script was loaded into the page along with the other content.
This did the trick:
$('a.thumb_link').lightBox();