Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #197

I have Image Gallery Magic and would like to make links on my page that jump to specific images in the gallery.

The Answer

Prepared Oct. 2006 by Al Sparber, PVII

Image Gallery Magic has an undocumented feature that allows you to jump to specific images in your gallery from within the gallery page. To deploy the function, you'll need to add a javascript event to your link calling the P7_HGStrig function, onclick.

To create a jump link to a specific image:

Select the text or image you want to use as your link and type a hash mark (#) in Dreamweaver's link box - on the property inspector.

Switch to code view and locate the link you just made. It should look something like this:

<a href="#">Jump to image 3</a>

Enter the function call just to the right of the hash mark's closing quote:

<a href="#" onClick="P7_HGStrig(2)">Jump to image 3</a>

The number in parentheses, after the function name, tells iGM which image to jump to. The images are kept in an array, which starts at number zero, so the third image is actually number 2 in the array (the first image is number zero).

The last step is to set the event to return false, which will prevent the browser from jumping to the top of the page every time the link is clicked.

Insert a semicolon just inside the ending quotation mark and type return false:

<a href="#" onClick="P7_HGStrig(2);return false">Jump to image 3</a>

That's it!

Back to the questions list