You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ab-lightbox

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ab-lightbox

Simplest vanilla lightbox you can imagine.

1.2.4
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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

Keywords

lightbox

FAQs

Package last updated on 29 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts