A simple lightbox module for displaying an image as a scaled up image.
-
Download the latest version,which includes both javascript and css files from here
-
To set up the lightbox on your page, inlucde both the css and javascript as follows:
- Include the CSS at the top of your page in your tag:
<link href="path/to/lightbox.css" rel="stylesheet">
- Include the Javascript at the bottom of your page before the closing tag:
<script src="path/to/lightbox.js"></script>
- Include the CSS at the top of your page in your tag:
-
Minimal Lightbox requires jQuery, so make sure it is included
- Make sure jQuery is loaded before lightbox.js.
- jQuery 1.7 or greater is required.
-
Make sure that the
<img>
to be displayed by the lightbox is enclosed within an<a class="lightbox-link"></a>
tagExample
<a class="lightbox-link"> <img src="images/image1.jpg" alt="Image Description Here"> </a>
-
The content of the
<alt>
tag will be displayed below the image in the lightbox. -
In your
script.js
file, initialize the plugin as follows.$('.lightbox-link').lightbox();
- Provide smoother transitions.
- Make Images to be displayed in a carousel/gallery manner.
- Write a vanilla javascript alternative for the plugin.
- Chrome
- Firefox
- Safari
- Opera