GithubHelp home page GithubHelp logo

nvdnkpr / bootstrap-lightbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jbutz/bootstrap-lightbox

0.0 2.0 0.0 781 KB

A simple lightbox plugin based on the bootstrap modal plugin.

Home Page: http://jbutz.github.com/bootstrap-lightbox/

License: Other

bootstrap-lightbox's Introduction

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 class='lightbox-footer'>
		<button class="btn btn-small btn-primary">Click</button>
	</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

Name Type Default Description
backdrop boolean true This adds a modal-backdrop element.
keyboard boolean true Pressing escape closes the lightbox.
show boolean true Shows the lightbox when initialized.
Note: This only applies when using JavaScript to setup the lightbox.
resizeToFit boolean true This resizes the image to fit the window if the image is too large.

bootstrap-lightbox's People

Contributors

jbutz avatar nicolap avatar xixixao avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.