This tutorial is going to show you how to implement the jQuery prettyPhoto lightbox plugin into your JS Animated template.
PrettyPhoto is a jQuery lightbox clone. It supports not only images, but also videos, flash, YouTube, iframes and ajax. It’s a full blown media lightbox.
To add it to your page:
Download prettyPhoto_compressed_3.1.5.zip from http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/ on your computer and unpack it.
Copy the js and css folders from the unzipped package and paste them into the site folder of your template package. Since you already have folders with the same names there, you will be asked to replace them. This will just add the files in these folders to them, so just go ahead and agree to the replacement.
Open the .html file with the image you want to apply the plugin to and add the libraries and the table of styles to it in DreamWeaver to the <head> section:
Find the line with the image, e.g.:
Initialize prettyPhoto: add the following to your .html file right before the closing </head> tag:
- Save the changes and check your page in a web browser: the image should be opening in a lightbox.
<img src="images/image_small.jpg " alt="" />
And change it to:
<a href="images/image_big.jpg" rel="prettyPhoto" title="Single Photo"><img src="images/image_small.jpg " alt=" " /></a>
In the images folder there should be image_big.jpg and image_small.jpg accordingly.
For more information on how to use the plugin, please refer to the official manual at http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/documentation.
Feel free to check the detailed video tutorial below: