LC-Lightbox-LITE icon indicating copy to clipboard operation
LC-Lightbox-LITE copied to clipboard

Bug when using multiple lightbox at same page

Open tanzeel opened this issue 6 years ago • 2 comments
trafficstars

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

tanzeel avatar Sep 19 '19 05:09 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.

LCweb-ita avatar Sep 19 '19 06:09 LCweb-ita

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?

tanzeel avatar Sep 20 '19 03:09 tanzeel