'gLightBox tries to open a Vimeo video instead of an image

I'm using gLightBox on my website here and everytime I click on an image, the pop-up attempts to convert the image into a Vimeo iframe embed which is not expected behavior.

When I look at it from my local machine, it works fine and looks like this: enter image description here

However, when I look at it from my live site, it looks like this: enter image description here

If you go to inspect the markup, you'll see that the lightbox is attempting to load a Vimeo video, but it should really just load the image.

I am hosting this server on GoDaddy.

Would anyone know how to fix this problem?

Thank you!



Solution 1:[1]

In your webpage, the img src has '?' sign after the 'jpg' extension which caused glightbox failed to recognize the filename type as image.

So, in the glightbox.js remove the '$' sign in the match function:

if (url.match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|svg)$/) !== null) {
  return 'image';
}

that is:

if (url.match(/\.(jpeg|jpg|jpe|gif|png|apn|webp|svg)/) !== null) {

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 myron c