1.1.5 • Published 6 years ago

lumenbox v1.1.5

Weekly downloads
17
License
MIT
Repository
github
Last release
6 years ago

lumenbox

version npm license

Javascript lightweight library for image overlays, no dependencies.

Installation

npm i lumenbox

Usage

1 Grab lumenbox.min.css and lumenbox.min.js from the /dist folder and include them in your page.

Include the css in the <head> of your page

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

And include the script right before the closing </body> tag

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

2 Initialize Lumenbox like so:

<script> var Lumenbox = new Lumenbox(); </script>

3 Add the data-lumenbox attribute to your pictures/gallery. Optionally you can use data-title or title attribute to also display a caption when image is shown.

Individual image

 <a href="..." data-lumenbox="example-image"><img src="..." alt="image-1" /></a>

Gallery (you have to use the same name on the data attribute)

<a href="..." data-lumenbox="example-image"><img src="..." alt="image-1" /></a>
<a href="..." data-lumenbox="example-image"><img src="..." alt="image-2" /></a>
<a href="..." data-lumenbox="example-image"><img src="..." alt="image-3" /></a>

Options

You can configure some options from the ones available below

Upon init you need to pass the options object like so:

var Lumenbox = new Lumenbox({ showCounter: true });
optioneffectdefault
countLabel: stringThe text that appears when navigating through the gallery'%current of %total'
showCounter: booleanShow/hide the counterfalse
infiniteNavigation: booleanWrap around the navigationfalse
enableKeyboardNavigation: booleanUse left/right arrows to navigate through the galleryfalse
transitionDuration: numberAnimation effects duration (ex. fadeIn, fadeOut)500
fitInViewport: booleanFit all the images inside the viewporttrue
backDropClose: booleanClose gallery when clicking overlaytrue
1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago