biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.01k stars 226 forks source link

Image count issue on adding content with AJAX #464

Closed startupcode closed 6 months ago

startupcode commented 6 months ago

Describe the bug We are using Glightbox to show gallery with load more functionality. We show by default 6 images then rest images in batch of 6 binds on clicking Load More. Say on clicking Load More, 3 more images add to the gallery.

When I click any of the default six images to open lightbox popup, it only had 6 slides with total image count 6 working like 1/6, 2/6 etc. and only slides through 6 images

When I click any of the images newly added from 7-9 to open lightbox popup, it only had 9 slides with total image count 9 working like 1/9, 2/9 etc. and it slides through all 9 images which is expected

Expected behavior Clicking any image after new images is added, it should have total image count like 9 in this case and slide through all 9 images.

Desktop: