mLightbox.js

A Micro lightbox gallery without dependencies

Installation

Install with npm

npm install mlightbox-js

Install from Github

Download directly from Github

Getting Started

Include the CSS at the top of your page in your <head> tag:

<link rel="stylesheet" href="path/to/mlightbox.min.css">

Include the Javascript at the bottom of your page before the closing </body> tag:

<script src="path/to/mlightbox.min.js"></script>

The markup

Add a mlightbox attribute in each image link to enable the gallery. For example:

<div>
<a href="path/to/image-1.jpg" mlightbox></a>
<a href="path/to/image-2.jpg" mlightbox></a>
<a href="path/to/image-3.jpg" mlightbox></a>
<a href="path/to/image-4.jpg" mlightbox></a>
</div>