This code has proven to be useful many times in the last few weeks. Clients come to me asking for different type of “galleries” for their images. This is the standard code that I use:

Step 1: Choose the image / space that will change, to display different images. You need to use a name tag inside of this image tag.

<img src=”images/1.jpg” name=”MainImage”>

Step 2: Setup your links. Each link needs to have an onClick tag. You can setup as many links as you like. You can also use thumbnails of the images as the links, since you may not want to use text.

<a href=”#” onClick=”document.MainImage.src=’images/2.jpg’;”>Click Here</a>

I will post a link, once I have a working example for one of my clients.

Posted by Chris, filed under Javascript, Web Development. Date: August 29, 2007, 7:17 am |

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.