andreknieriem / simplelightbox

Touch-friendly image lightbox for mobile and desktop
https://simplelightbox.js.org
MIT License
1.11k stars 173 forks source link

how to make simpleLightBox work from MagnificPopup loaded via Ajax #306

Open avidh opened 1 year ago

avidh commented 1 year ago

Hi,

I've been scratching my head over this for few days now and I couldn't find the answer. Maybe it's not possible to achieve what I want to do but I thought it was worth asking before I finally give up.

I'm loading MagnificPopup via Ajax and that ajax content has a image thumb nail, which I would like to open using SimpleLightBox but I can't figure out how to do this. I understand that my main parent page is already initialized with SimpleLightBox library and it does not know about the new content loaded from ajax, which is not even full DOM object but I was wondering if this is even possible... Thank you for your advise in advance.