Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bootstrap-lightbox

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap-lightbox

A simple lightbox plugin based on the bootstrap modal plugin.

  • 0.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-35.82%
Maintainers
1
Weekly downloads
 
Created
Source

Bootstrap - Lightbox Build Status

This is a plugin for Twitter Bootstrap that adds a lightbox that is based off the modal dialog

Quick start

You have several options. You can clone the repository git clone git://github.com/jbutz/bootstrap-lightbox.git, grab an archive, or use cdnjs.

Once you have the files include the CSS and JavaScript files in your page and then give the example code below a shot.

Example

<a data-toggle="lightbox" href="#demoLightbox">Open Lightbox</a>
<div id="demoLightbox" class="lightbox hide fade"  tabindex="-1" role="dialog" aria-hidden="true">
	<div class='lightbox-header'>
		<button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">&times;</button>
	</div>
	<div class='lightbox-content'>
		<img src="image.png">
	</div>
</div>

Usage

Via data attributes

All you need to do is add data-toggle="lightbox" and href="#lightbox" or data-target="#lightbox" to a link, and set the href so it references the lightbox you want to display.

<a data-toggle="lightbox" href="#demoLightbox">Open Lightbox</a>

Via JavaScript

Open the lightbox with the id myLightbox.

$('#myLightbox').lightbox(options)

Options

NameTypeDefaultDescription
backdropbooleantrueThis adds a modal-backdrop element.
keyboardbooleantruePressing escape closes the lightbox.
showbooleantrueShows the lightbox when initialized.
Note: This only applies when using JavaScript to setup the lightbox.
resizeToFitbooleantrueThis resizes the image to fit the window if the image is too large.

FAQs

Package last updated on 21 Jul 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc