Home
Image Effects
Image Galleries
and Viewers
Here
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
FF1+ IE5+ Opr7+
Photo Album script v2.0 Author:
Mar 11th, 07': Updated to v2.0, which adds support for multiple albums on the same page, ability to run custom code when an image is clicked on. Description: Photo Album script is ideal for displaying multiple images at once, with links to cycle through additional batches of images. But that's just the beginning. Here are some highlights:
Now go show off your photo album! Demo Step 1: Add the following CSS to the <head> section of your page: Since the script references an external .js file, you need to download the below: photogallery.js (right click, and select "Save As") Step 2: Add the below code to the <BODY> section of your page where you wish the photo album to appear: All configurations to the script is done inside the code of Step 2. As shown, the basic code looks like this: //Define your own array to hold the photo album images Whereby you first define an array holding your images, using the syntax: Syntax: ["path_to_thumbnail", "opt_image_title", "opt_destinationurl", "opt_linktarget"] Then, create an album using it, by calling new var thepics=new photogallery(myvacation, 3, 1, '700px', '600px') The 1st parameter should be the name of your array image, the 2nd and 3rd are
the number of cols and rows to generate for this album, and the 4th and 5th (' var thepics=new photogallery(myvacation, 3, 1, '700px', '600px', ['Browse Gallery:', 'Page']) Note the Using the custom event handler "onselectphoto"Here comes the fun part- this script lets you customize the behaviour when the
user clicks on each image within the photo album. By default, if an image is
hyperlinked, clicking on it will obviously go to that URL. But what if you wish
to override this behaviour, and instead, load the link in a custom popup window
instead? Simply call " thepics.onselectphoto=function(img,
link){ Note that " thepics.onselectphoto=function(img, link){ Here's an example: |