Home

Awesome

vanilla-lightbox powered by vanilla.js

🔨 Create simple lightbox gallery.

Preview 🎉

https://piecioshka.github.io/vanilla-lightbox.js/demo/

Usage

  1. In HTML file attach files src/lightbox.css and src/lightbox.js.

  2. In HTML file:

    <a href="https://example.com/link-1" rel="lightbox">
        <img src="image-1.jpg" alt="example text" />
    </a>
    
    <a href="https://example.com/link-2" rel="lightbox">
        <img src="image-2.jpg" alt="example text 2" />
    </a>
    
  3. Run this JavaScript code, when DOM is ready:

    new LightBox();
    

Options

rel {string}

Define this attribute in item which should display in lightbox.

prev {string}

Label of button which display previous image.

next {string}

Label of button which display next image.

Support

Acknowledge

lightbox - light (white) container centered above dark background.

License

The MIT License @ 2013