Fork me on GitHub

Default gallery


let el = document.getElementById('gallery');
let gallery = new VanillaBox(el);
                

No screen controls (swipe or keyboard)


let el = document.getElementById('gallery');
let gallery = new VanillaBox(el,{
    screenControls:false
});
                

Disable looping and opening on thumbnail click


let el = document.getElementById('gallery');
let gallery = new VanillaBox(el,{
    loop: false,
    imageListeners: false,
});

btn.addEventListener("click", function(){
    gallery.open();
});
                

Single image


let el = document.getElementById('gallery');
let gallery = new VanillaBox(el);