biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.01k stars 226 forks source link

Duplicate instances on one page #467

Closed JamesAllgood closed 4 months ago

JamesAllgood commented 5 months ago

Describe the bug The gallery code is show multiple times on certain pages on my website.

When this happens the last gallery works but the others just show the progress bar

To Reproduce Steps to reproduce the behavior:

  1. Go to https://themeparkguide.co.uk/archive/Creek-Freak-Massacre
  2. Scroll to the first gallery and click on a photo and it works
  3. Scroll down to the next gallery and try click on a photo and it opens up the file in a window not using the Lightbox
  4. See error

Expected behavior It should show the gallery

Desktop:

JamesAllgood commented 4 months ago

Still having an issue where the first gallery works fine then the second and third just opens up photos like a file not using the light box

gingerchew commented 4 months ago

Can you create an isolated test case? Putting it into a codepen helps us immensely.

JamesAllgood commented 4 months ago

my issue turned out to be some parts of my code couldn't see the script. issue was on my side :)