image gallery lightjs - Free Download Tiny Lightbox Plugin For Images And Galleries - light.js

Free Download Tiny Lightbox Plugin For Images And Galleries – light.js

Posted on

This time I will share jQuery Plugin and tutorial about Tiny Lightbox Plugin For Images And Galleries – light.js, hope it will help you in programming stack.

image gallery lightjs - Free Download Tiny Lightbox Plugin For Images And Galleries - light.js
File Size: 8.2 KB
Views Total: 1349
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A super tiny and fully responsive lightbox jQuery plugin to showcase your images and/or image groups in a simple, elegant way.

More features:

  • Supports image descriptions/captions.
  • Next/prev buttons to navigate between images in a group.
  • Click outside to close the lightbox.
  • Keyboard interactions.
  • Image not Found handling.

How to use it:

1. Insert the stylesheet jquery.light.css and JavaScript jquery.light.js into the HTML file.

1 <link rel="stylesheet" href="./src/jquery.light.css" />
2 <script src="/path/to/cdn/jquery.min.js"></script>
3 <script src="./src/jquery.light.js"></script>

2. Insert image links to the a tag and define the descriptions in the data-caption attribute.

1 <a href="full.jpg"
2    data-caption="This is my caption"
3    rel="light">
4    <img src="thumb.jpg">
5 </a>

3. To create a gallery lightbox, just group the images using the data-gallery attribute.

01 <a href="full-1.jpg"
02    data-caption="This is my caption"
03    data-gallery="1"
04    rel="light">
05    <img src="thumb-1.jpg">
06 </a>
07  
08 <a href="full-2.jpg"
09    data-caption="This is my caption"
10    data-gallery="2"
11    rel="light">
12    <img src="thumb-2.jpg">
13 </a>
14  
15 <a href="full-3.jpg"
16    data-caption="This is my caption"
17    data-gallery="3"
18    rel="light">
19    <img src="thumb-3.jpg">
20 </a>

4. Initialize the lightbox plugin on the image links. Done.

1 $(function() {
2   $('a[rel=light]').light();
3 });

5. Customize the prev/next/loading/error text.

1 $(function() {
2   $('a[rel=light]').light({
3     prevText:'Previous',
4     nextText:'Next',
5     loadText:'Loading...',
6     errorText:'Image not Found'
7   });
8 });

6. Enable/disable the keyboard support. Default: true.

1 $(function() {
2   $('a[rel=light]').light({
3     keyboard: true
4   });
5 });

7. Determine whether to disable the Click event on the element. Default: true.

1 $(function() {
2   $('a[rel=light]').light({
3     unbind: true
4   });
5 });

This awesome jQuery plugin is developed by edmundgentle. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net