1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> 4<head> 5 6 <title>Lightbox JS v2.0 | Test Page</title> 7 8 <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> 9 10 <script src="js/prototype.js" type="text/javascript"></script> 11 <script src="js/scriptaculous.js?load=effects" type="text/javascript"></script> 12 <script src="js/lightbox.js" type="text/javascript"></script> 13 14 <style type="text/css"> 15 body{ color: #333; font: 13px 'Lucida Grande', Verdana, sans-serif; } 16 </style> 17 18</head> 19<body> 20 21 22<h1><a href="http://www.huddletogether.com/projects/lightbox2/">Lightbox JS <em>v2.0</em></a></h1> 23<p><a href="http://www.huddletogether.com">by Lokesh Dhakar</a></p> 24 25<h2>Example</h2> 26 27<a href="images/image-1.jpg" rel="lightbox"><img src="images/thumb-1.jpg" width="100" height="40" alt="" /></a> 28 29 30 31 32<h2>How to Use:</h2> 33<h3>Part 1 - Setup</h3> 34<ol> 35<li>Lightbox v2.0 uses the Prototype Framework and Scriptaculous Effects Library. You will need to include these three Javascript files in your header. 36<pre><code><script type="text/javascript" src="js/prototype.js"></script> 37<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script> 38<script type="text/javascript" src="js/lightbox.js"></script> 39</code></pre> 40</li> 41<li>Include the Lightbox CSS file (or append your active stylesheet with the Lightbox styles). 42<pre><code><link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> 43</code></pre> 44</li> 45<li>Check the CSS and make sure the referenced <code>prevlabel.gif</code> and <code>nextlabel.gif</code> files are in the right location. Also, make sure the <code>loading.gif</code> and <code>closelabel.gif</code> files as referenced near the top of the <code>lightbox.js</code> file are in the right location.</li> 46</ol> 47<h3>Part 2 - Activate</h3> 48<ol> 49<li>Add a <code>rel="lightbox"</code> attribute to any link tag to activate the lightbox. For example: 50<pre><code><a href="images/image-1.jpg" rel="lightbox" title="my caption">image #1</a> 51</code></pre> 52<em>Optional: </em>Use the <code>title</code> attribute if you want to show a caption. </li> 53<li>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. For example: 54<pre><code><a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a> 55<a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a> 56<a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a> 57</code></pre> 58No limits to the number of image sets per page or how many images are allowed in each set. Go nuts!</li> 59</ol> 60 61 62</body> 63</html> 64