Home » News » Slightly Thicker Box: New Java ...

News by JavaScriptSearch


Slightly Thicker Box: New JavaScript Library for Online Image Galleries

 

JavaScriptSearch
Friday, July 7, 2006; 06:20 AM

In the beginning, there was the Lightbox.  The idea of using a small JavaScript library to display pictures in a "box" layer on top of the webpage became popular, and now there are Thickbox, Litebox, and Litbox, to name a few. The Thickbox script differed from the original Lightbox in its ability to display file formats other than images.


Jason Levine has modified Thickbox to create Slightly ThickerBox - a script that tries to improve on its predecessors.  Slightly ThickerBox relies on the lightweight Javascript framework jQuery.

Says the author:

"The modifications allow the script to generate "Previous Image" and "Next Image" links. The result is that you can use Slightly ThickerBox to create image galleries. In addition, you can create groups of galleries by setting a "rel" attribute on the links. (I also moved the Caption and Close link to the top and made the script case insensitive.)"

Usage is identical to other Lightbox clones. The following code goes in the <HEAD> section of the webpage:

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/thickbox.js"></script>
<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />

 

Then place this in the <BODY>, and your JavaScript image display is all set:

<a href="Filename.jpg" class="thickbox" rel="GroupName" title="Caption goes here" target="_blank"><img src="Thumbnail.jpg" /></a>

Advertisement

Partners

Related Resources

Other Resources

arrow