Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

compatibility with query string images for video detection upgrade. (fix included) #97

Description

@HawkenKing

If you are detecting images or videos and an image is loaded with a query string, for example in wordpress with a plugin, the lightbox can default to a video iframe if your code is augmented to run videos.

Here is a fix to keep images from turning into iframes when they have a query string url:

SlickLightbox.prototype.detectImage = function(url) {
    // Remove query string 
    url = url.split('?')[0];

    // Returns true if it finds an image file extension
    return url.match(/\.(jpeg|jpg|gif|png|webp)$/i) !== null;
};

Also added support for webp.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions