Minimal Image Lightbox Library – Views.js

Category: Javascript , Modal & Popup | December 5, 2016
Author: adrianklimek
Views Total: 286
Official Page: Go to website
Last Update: December 5, 2016
License: MIT

Preview:

Minimal Image Lightbox Library – Views.js

Description:

Views.js is a lightweight vanilla JavaScript plugin which enables you open and display your images in a responsive, configurable lightbox popup.

How to use it:

Place the main JavaScript file right before the closing body tag.

<script src="src/views.js"></script>

Initialize the Views.js with default options.

var viewer = new Views(Element);

Customize the image lightbox with the following options.

var viewer = new Views(Element,{
    defaultTheme: true,
    prefix: '',
    loader: '',
    closeButton: '<svg version="1.1" id="close-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve"><line fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="6.808" y1="6.808" x2="25.192" y2="25.192"/><line fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" x1="6.808" y1="25.192" x2="25.192" y2="6.808"/></svg>',
    anywhereToClose: true,
    openAnimationDuration: 0,
    closeAnimationDuration: 0
});