dbrekalo / simpleLightbox

SimpleLightbox is lightweight and responsive lightbox library with no dependencies. Display images, galleries, videos or custom content and control your lightbox with easy to use api.
http://dbrekalo.github.io/simpleLightbox/
MIT License
263 stars 76 forks source link

BUG: First image stays up when filter revisited if set up with new SimpleLightbox() construct #21

Open DanielSwain opened 4 years ago

DanielSwain commented 4 years ago

When using the new SimpleLightbox(elements: someFilterValue) construct, if a subset of photos on a page is set up to be viewed by SimpleLightbox, and subsequently another subset is set up with new SimpleLightbox(elements: aDifferentFilterValue), and then the first set is again set up with new SimpleLightbox(elements: someFilterValue), then when the first photo in the first-setup subset of photos is clicked to view in SimpleLightbox, this first photo remains displayed under any photos that are next displayed when the Next or Previous buttons are clicked. This behavior only occurs when using the new SimpleLightbox(elements: someFilterValue) construct to set up the lightbox. If the jQuery construct is used --- $('someFilterValue').simpleLightbox() --- then this error does not occur.