Hello,
I'm using pro version of your great lightbox plugin for WordPress, and am having a problem I hope you'll be able to help me with.
On one of the user profile pages, I'm calling a gallery (custom attachment display code) page though AJAX (user needs to stay on same profile tab, so this is a workaround). I've built the gallery code to include the necessary ARI classes, but whe I click one of the AJAX loaded thumbnails, nothing happens.
I've read about it & had found that I have to reinitialize the lightbox after the new AJAX content is loaded, but am not a programmer and not sure what's the code/function to do so, nor where to put the code. Any suggestions? Thanks!
Current code (with loader image):
Code: |
// Catch the click on your a tag
$(document).ready(function(){
var trigger = $('#albumsdiv a'),
container = $('#albumsdiv');
trigger.on('click', function(e){
var $this = $(this),
target = $(this).attr('href');
// Load the content of the page referenced in the a-tags href
container.load(target);
// Prevent browsers default behavior to follow the link when clicked
return false;
});
});
$(document).ajaxStart(function(){
$("#load").css("display", "block");
});
$(document).ajaxComplete(function(){
$("#load").css("display", "none");
});
|