Closed ghost closed 4 years ago
I was able to solve this problem simply by doing:
$('.lightbox').remove ();
before creating the modal or when it is closed.
was this fix not included in the current release?
Still having issues with this. Updated the code at line 97
Lightbox.prototype.build = function() {
$('.lightbox').remove(); // Added code here based on above comment.
if ($('#lightbox').length > 0) {
return;
}
I am getting the same issue when I open and close it. These are the errors:
Uncaught TypeError: Cannot read properties of undefined (reading 'css') lightbox.js?ver=3be55b05081a63d8f9d0ecb466c42cfe:263
at Lightbox.start (lightbox.js?ver=3be55b05081a63d8f9d0ecb466c42cfe:263:20)
at HTMLAnchorElement.
Uncaught TypeError: Cannot read properties of undefined (reading 'width') lightbox.js?ver=3be55b05081a63d8f9d0ecb466c42cfe:394 at lightbox.js?ver=3be55b05081a63d8f9d0ecb466c42cfe:394:10
I am using lightbox2 v2.11.4. Is there a way to fix this?
Lightbox v2.11.1
I'm using Jquery version 2.1.3, and also bootstrap 3.
when I open a modal window the first time. all right.
but when I close and open it again and click on the image, the following error appears:
Cannot read property 'css' of undefined
looking where the error originated, is here:
if I replace
this. $ lightbox.css
with$ (". lightbox")
it works again, but other cascading errors begin to appear.