disableLocalStorage
To improve the performance, the lightbox caches detected types in the local storage. To disable it, set the "disableLocalStorage" prop to "true".
fsLightbox.props.disableLocalStorage = true;
To improve the performance, the lightbox caches detected types in the local storage. To disable it, set the "disableLocalStorage" prop to "true".
fsLightbox.props.disableLocalStorage = true;
By default, the lightbox won't stop the slideshow at the last slide but let it loop over to the first slide. Set this prop to "true" to disable this behavior.
fsLightbox.props.disableSlideshowLoop = true;
By default, the lightbox will exit the fullscreen on close. To change it, set the "exitFullscreenOnClose" prop to "false".
fsLightbox.props.exitFullscreenOnClose = false;
By default, the lightbox loads 3 stage sources—previous, current, and next—after opening and after a slide change. If the "loadOnlyCurrentSource" prop is set to "true", the lightbox will load only the current source.
fsLightbox.props.loadOnlyCurrentSource = true;
The lightbox cannot detect maximum sizes of YouTube videos (however, by default it sets them to 1920 × 1080). To change them, you can use the "data-width" and "data-height" attributes.
<a
data-fslightbox
data-width="1000"
data-height="500"
href="https://www.youtube.com/watch?v=3nQNiWdeH2Q"
>YouTube</a>
Or using the "maxYoutubeDimensions" object prop.
fsLightbox.props.maxYoutubeDimensions = { width: 1920, height: 1080 };
The lightbox adds vertical margin and, on desktop screens, horizontal margin to sources. The default value is five percent (0.05).
fsLightbox.props.sourceMargin = 0.01;
The distance between the slides visible during swiping—x * window.innerWidth (by default, 0.3).
fsLightbox.props.slideDistance = 0.5;
To edit the properties of the toolbar and slide buttons, overwrite adequate props in an analogous way to the given example (there are four editable props for each button):
fsLightbox.props.toolbarButtons.thumbs = {
class: "btn-thumbs", // A CSS class setting icon's dimensions
viewBox: "0 0 278 278",
d: "M0 0 H119.054 V119.054 H0 V0 z M158.946 0 H278 V119.054 H158.946 V0 z M158.946 158.946 H278 V278 H158.946 V158.946 z M0 158.946 H119.054 V278 H0 V158.946 z",
title: "Thumbs"
};
fsLightbox.props.toolbarButtons.zoomIn.title = "Increase";
fsLightbox.props.toolbarButtons.zoomOut.class = "btn-zoom-out"; // A CSS class setting icon's dimensions
fsLightbox.props.toolbarButtons.zoomIn.viewBox = "0 0 20 20";
fsLightbox.props.toolbarButtons.slideshow.start.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";
fsLightbox.props.toolbarButtons.slideshow.pause.viewBox = "0 0 50 50";
fsLightbox.props.toolbarButtons.fullscreen.enter.title = "Show";
fsLightbox.props.toolbarButtons.fullscreen.exit.title = "Stop";
fsLightbox.props.toolbarButtons.close.viewBox = "0 0 25 25";
fsLightbox.props.slideButtons.previous.d = "M0 0 H119.054 V119.054 H0 V0 z M158.946 0 H278 V119.054 H158.946 V0 z M158.946 158.946 H278 V278 H158.946 V158.946 z M0 158.946 H119.054 V278 H0 V158.946 z";
fsLightbox.props.slideButtons.next.viewBox = "0 0 17 17"
When the slideshow is turned on, the time that needs to pass to change the slide to the next one (in milliseconds).
fsLightbox.props.slideshowTime = 10000;
The time after which the lightbox's UI fades out (in milliseconds). The prop may be set to 0 to disable the fade-out.
fsLightbox.props.UIFadeOutTime = 10000;
The value that increases the source's scale on a click zoom (by default, 0.25—that is, the size of the source is increased by 25%).
fsLightbox.props.zoomIncrement = 0.5;
Disables the closing of the lightbox when the background is clicked.
fsLightbox.props.disableBackgroundClose = true;
Preserve the display of captions when thumbs are opened.
fsLightbox.props.showThumbsWithCaptions = true;