1.2.4 • Published 10 years ago

ab-lightbox v1.2.4

Weekly downloads
9
License
MIT
Repository
github
Last release
10 years ago

ab-lightbox

Simplest vanilla lightbox you can imagine.

Features:

  • black transparent background (with fade-in)
  • loads the given image URL and shows the loaded image (with fade-in)
  • limits the size of the image based on screen size and given constraints
  • closes the lightbox upon click / touchstart (with fade-out)
  • disables scroll while lightbox is visible
  • removes DOM elements and event listeners after lightbox is closed

Install

With npm do:

$ npm install ab-lightbox --save-dev

Usage

var lightbox = require('ab-lightbox');

// default settings are shown.

lightbox.createlightbox({
	imageURL 				: 'http://lorempixel.com/400/200/',
	closeOnBGClick 			: true,
	fadeOut					: true,
	bgOpacity				: 0.6,
	maxHeightPercent		: 0.6,
	maxWidthPercent			: 0.6,
});

License

MIT

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

0.0.2

11 years ago

0.0.1

11 years ago