Closed rafasegat closed 9 years ago
Any answer?
Hi, You have to destroy the plugin and re-initiate it after clicking on load more button.
var gallery = $('#gallery').lightGallery();
$('#load-more').on('click', function() {
gallery.destroy();
gallery = $('#gallery').lightGallery();
});
Thanks so much sachinchoolur!
That was a huge issue on my plugin and now its working fine.
I`ll put considerations and show LightGallery plugin on my codecanyon plugin page
Thanks so much! Raf
Finally I got resolved my problem in ajax load more new images into lightgallery:
var $lg = jQuery('div#animated-thumbnials');
$lg.lightGallery();
$lg.data('lightGallery').destroy(true);
$lg.lightGallery();
Thanks, guys for the destroy function hint.
Hey,
I have a issue. My gallery and LightGallery are working perfectly but I have a Load More button that load more photos using ajax. So I call LightGallery function again and does not work well.
Example http://instagramwordpress.rafsegat.com/
Thanks so much and beautiful plugin BTW