Fullscreen Lightbox Javascript Fullscreen Lightbox ,React Fullscreen Lightbox Vue

Vanilla JS Lightbox Documentation

Learn how to use the Vanilla JavaScript version of Fullscreen Lightbox.

Thumbs of images are created automatically.
To create a thumb of a different source or overwrite the default thumb's image (for example, with an equivalent image of smaller resolution for increased performance), pass the URL or path of the image intended to be the thumb to the "data-thumb" attribute.

<a
data-fslightbox="gallery"
data-thumb="/Images/Thumbs/1.jpg"
href="https://www.youtube.com/watch?v=3nQNiWdeH2Q"
>
A YouTube video.
</a>

Or using the JavaScript "thumbs" array prop:

fsLightboxInstances["gallery"].props.thumbs = ["/Images/Thumbs/1.jpg"];

Thumbs icons

When displaying videos, showing icons on thumbs may improve the user experience. It can be achieved using the "thumbsIcons" prop. It's an array of SVG icons.

var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svg.setAttributeNS(null, "width", "30px");
svg.setAttributeNS(null, "height", "30px");
svg.setAttributeNS(null, "viewBox", "0 0 512 512");
var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
path.setAttributeNS(null, "d","M490.24,113.92c-13.888-24.704-28.96-29.248-59.648-30.976C399.936,80.864,322.848,80,256.064,80c-66.912,0-144.032,0.864-174.656,2.912c-30.624,1.76-45.728,6.272-59.744,31.008C7.36,138.592,0,181.088,0,255.904C0,255.968,0,256,0,256c0,0.064,0,0.096,0,0.096v0.064c0,74.496,7.36,117.312,21.664,141.728c14.016,24.704,29.088,29.184,59.712,31.264C112.032,430.944,189.152,432,256.064,432c66.784,0,143.872-1.056,174.56-2.816c30.688-2.08,45.76-6.56,59.648-31.264C504.704,373.504,512,330.688,512,256.192c0,0,0-0.096,0-0.16c0,0,0-0.064,0-0.096C512,181.088,504.704,138.592,490.24,113.92z M192,352V160l160,96L192,352z");
svg.appendChild(path);
fsLightboxInstances["gallery"].props.thumbsIcons = [svg];

Display thumbs at start

To show thumbs on the lightbox's open, set the "showThumbsOnMount" prop to "true".

fsLightbox.props.showThumbsOnMount = true;

Disable thumbs

To disable thumbs completely, set the "disableThumbs" prop to "true".

fsLightbox.props.disableThumbs = true;
Look over the Fullscreen Lightbox open source plug-ins.