new ImageLightbox(
document.querySelectorAll('a[data-imagelightbox="j"]'),
{
arrows: true,
history: true,
},
);
Open with ?imageLightboxIndex=2 added to the url to open the third image (may need to add &imageLightboxSet=j as well because there are multiple examples)
History with ids
new ImageLightbox(
document.querySelectorAll('a[data-imagelightbox="k"]'),
{
arrows: true,
history: true,
},
);
Add data-ilb2-id="img2" and open with ?imageLightboxIndex=img2 added to the url to open that image (may need to add &imageLightboxSet=k as well because there are multiple examples)
Video support
Add data-ilb2-video to the link, containing the parameters of a HTML5 video tag as JSON. You can also include a sources field - a list of source tags similarily encoded.
Press enter for fullscreen
new ImageLightbox(
document.querySelectorAll('a[data-imagelightbox="fullscreen"]'),
{
fullscreen: true,
},
);
Filter images by extension
Allow gif only
new ImageLightbox(
document.querySelectorAll('a[data-imagelightbox="allowedtypes"]'),
{
allowedTypes: "gif",
},
);