Home > Javascript > Minimal Image Lightbox Library – Views.js
Minimal Image Lightbox Library – Views.js

Minimal Image Lightbox Library – Views.js

Minimal Image Lightbox Library – Views.js A Lightweight vanilla JavaScript image viewer.

Bower installation

To install via Bower, simply do the following:

$ bower install views --save

Usage

For default viewer:

var viewer = new Views(element);

element must be an anchor element with the href attribute

If you want to use viewer with custom options:

var viewer = new Views(element, {
    defaultTheme: true,    // If you don't want to use the default viewer theme, disable this option  
    prefix: '',    // You can add prefix to html ids and classes of the viewer's elements, e.g. if you want to set up multiple viewer instances with different styles
    loader: '',    // Can be a html or a text, it will be inserted to the loader
    closeButton: '',   // Can be a html or just a text, it will be inserted to the close button
    anywhereToClose: true,    // By default you can click anywhere to close viewer
    openAnimationDuration: 0,    // If you use css animations set this option with opening animation duration in ms (without ms)
    closeAnimationDuration: 0    // If you use css animations set this option with closing animation duration in ms (without ms)
});
  Website Demo

About admin