LC-Lightbox-LITE
LC-Lightbox-LITE copied to clipboard
Bug when using multiple lightbox at same page
Hi,
Library has one bug when using multiple time on same page. It also appears on your website https://lcweb.it/lc-lightbox (not every time but some time js error appear about blocking the iframe and lightbox doesn't work). Link of screenshot of your website: https://ibb.co/s9MCNCB
Can you please suggest how to fix it?
Tanzeel
Hello Tanzeel, I tried multiple times playing with it, but never faced the issue. You area also the only one reporting it.
Finally: the first cross-origin on your side is about Facebook, a whitelisted domain that normally doesn’t trigger that error.
Yeah, but it shouldn't break anyway.
$.each(lcl_objs, function(i, v) { if(JSON.stringify(v) == JSON.stringify(obj)) { already_init = v; return false; } });
This comparison is problematic in my case. When initializing lightbox using selector, i don't think this is going to matter anyway. Removing this piece of code fixed my problem. I don't see this calling twice in my case. Is there any corner case where this code is useful?