Open COLABORATI opened 8 years ago
You just need to work with the method ajaxComplete. Like this, so you gonna call the lightbox function only after the ajax call has complete.
$(document).ajaxComplete(function(event,request,settings){
$('.fotos-links2 a').magnificPopup({type:'image'});
});
Similar issues here, having trouble with a simple photo gallery through ajax. Anyone have an example?
I had a similar issue. I fixed it by placing the following in my javascript file (outside of the document ready function):
$(document).ajaxComplete(function(event,request,settings)
{
$('[your gallery class here]').each(function() {
$(this).magnificPopup({
delegate: 'a',
type: 'image',
gallery:{enabled:true}
});
});
});
Hope this helps
I tried several variations of this:
1.) Load ajax content from link 2.) inside that ajax content is a simple div with image links (can be modified) 3.) from that content received via ajax create a popup with gallery that navigates the contained imgs.
I tried everything, no success. How can I load a list of image links via ajax and then make a gallery of them? I tried several variations of
gallery: true
and I do not understand howdelegate
comes into play with this.I can not understand from the docs how to do it - please, Dmitry, would you like to show an example of how to do this? Thanks!