banthagroup / fslightbox

An easy to use vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.
MIT License
351 stars 30 forks source link

Re-Init after ajax load #110

Closed jesserosenfield closed 4 years ago

jesserosenfield commented 4 years ago

Hello!

Thanks so much for this wonderful plugin. Amazing work!

Is there a way to re-initialize fslightbox on [data-fslightbox] elements after they've been loaded to the DOM dynamically. In my particular case I'm using a plugin called swup js https://swup.js.org

moeenxyz commented 4 years ago

I have the same problem. I'm using swup but can't re-initialize fslighbox.

AlexAntonyan commented 4 years ago

refreshFsLightbox();

piotrzdziarski commented 4 years ago

Just use refreshFsLightbox after ajax load: [https://fslightbox.com/javascript/documentation/how-to-use#refreshing](https://fslightbox.com/javascript/documentation/how-to-use#refreshing