You are here: Home > Web Design > Enlarged Images Tutorial
Wednesday, 20 December 2006
Pop up boxes are dead.
They have been for a while. Replaced now with Ajax based creations and DHTML popups.
At the request of a few visitors, here is a tutorial on implementing Lightbox JS 2.
The image below shows what happens to the images when Lightbox JS 2 is used:

Okay, so not a great image but I shall explain what happens.
Your visitor clicks on the picture and Lightbox JS 2 darkens the background and shows a full sized version of the image. This script is great for thumbnail galleries or showing small sections of pictures encouraging users to view the full picture.
It is also good for slideshows as you can group images together.
Here are the instructions to get you going:
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /><a href="images/image-1.jpg" rel="lightbox" title="Enlarge my Dog photo"><img src="Dog photo thumbnail" alt="Dog photo thumbnail" title="Dog photo thumbnail" width="150" height="80"</a>rel="lightbox" section. This activates the script that darkens your screen and shows an enlarged image.rel="lightbox" tag. So for example, I have three photos of dogs, I would use the rel="lightbox[dogshow]" tag on all three to create a slideshow.
Bookmark this article in Bumpzee, Del.icio.us, Digg and Stumble Upon
Technorati tags: lightbox, javascript, ajax, web2.0
You may also be interested in reading:
Care to Comment?Comments are manually approved and hence can a while to appear. Questions, informative posts, and feedback comments are gladly accepted. Spam is deleted. Spam-type comments have their links removed (Comment Policy)
Please allow 1 minute to connect. Please quote code DF

2009:
2008: