Lightbox is a simple, unobtrusive script used to overlay images on top of the current page. It's a snap to setup and works on all modern browsers.


Single image

Image set

Plants: image 1 0f 4 thumb
Plants: image 2 0f 4 thumb
Plants: image 3 0f 4 thumb
Plants: image 4 0f 4 thumb


  • Includes:
  • index.html
  • js/jquery-1.7.2.min.js
  • js/lightbox.js
  • css/lightbox.css
  • images/close.png
  • images/loading.gif
  • images/next.png
  • images/prev.png
  • Plus a few files for the demo page

Lightbox2 is open-source.
Fork the code on Github.


Show older changes

How to use

Part 1 - Setup

  1. Lightbox 2 uses the jQuery framework. Load jQuery and the Lightbox javascript files in the proper order.
    <script src="js/jquery-1.7.2.min.js"></script>
    <script src="js/lightbox.js"></script>
  2. Include the Lightbox CSS file.
    <link href="css/lightbox.css" rel="stylesheet" />
  3. Check the CSS and make sure the referenced prev.png and next.png files are in the right location. Also, make sure the loading.gif and close.png files as referenced near the top of the lightbox.js file are in the right location.

Part 2 - Activate

  1. Add a rel="lightbox" attribute to any link tag to activate Lightbox.
    <a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a>
    Optional: Use the title attribute if you want to show a caption.
  2. If you have a set of related images that you would like to group, follow step one but additionally include a group name between square brackets in the rel attribute.
    <a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
    <a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a>
    <a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a>
    No limits to the number of image sets per page or how many images are allowed in each set. Go nuts!


For personal support issues and feature requests please post a message in the forums. I do not have time to personally respond to support emails, please use the forum. Thanks!

For bug reports, send a note with the browser you are using and the version of Lightbox to lokesh.dhakar@[ google's email service ].com.

Speech bubbles

Find me elsewhere