I would like to populate a lightbox with dynamically loaded images from a third-party API. I receive the data fine from the API, and the thumbnails populated just fine. But if I click on the thumbnail it wants to download the image instead of open in lightbox.
Lightboxes generate a chunk of JSON to support the lightbox UX, so if you’re modifying the lightbox elements after page load, you’ll likely need to re-initialize them.
You can research the forums for anything related to IX2 re-initialization, you’ll find some related techniques there, but here’s my best guess for lightbox without investigating it.
Thank you. I am already re-initalizse the IX2. As you suggested, and it isn’t helping. I tried to search in forums, but couldn’t really figure this out. Can you help?
Yes if you need some professional work done, you can click my name to message me and I can send you my rates.
I haven’t investigated your code, but as you can see in my demo dynamic lightboxes and resetting them works fine, so the most likely issue is timing. Your code need to run completely, pre-create the lightboxes correctly, then run reset so Webflow.js can build what it needs for them to function.