View Single Post
Old 06-16-2009, 11:50 AM   #1 (permalink)
Jason
Contributing Member
 
Jason's Avatar
 
Join Date: 05-17-04
Location: London, United Kingdom
Posts: 710
iTrader: 0 / 0%
Latest Blog:
None

Jason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of lightJason is a glorious beacon of light
Send a message via MSN to Jason
Simple JavaScript help please - image embedding

Hi all, I hope this finds you all well!

I have a website that will need to handle about 20+ images per page, but for the sake of a clean layout I want them arranged so the user scrolls through a couple of tiny galleries instead of being presented with a long stream and having work their way through.

Code:
<script> function changeImage(filename) { document.mainimage.src = filename; } </script> <p align="center"> <img name="mainimage" src="DSCF2715.JPG"></p> <p align="center">Images: <a href="javascript:changeImage('DSCF2715.JPG')">1</a> <a href="javascript:changeImage('DSCF0605.JPG')">2</a> <a href="javascript:changeImage('image3.jpg')">3</a> <a href="javascript:changeImage('image4.jpg')">4</a> <a href="javascript:changeImage('image5.jpg')">5</a></p>
That said, I've found an image click-through gallery script here... but it only seems to work once per page; any more times and those below the top click-through fail to work. How can this be manipulated in a way to be used several times loading different, pre-defined images?

ONLINE DEMONSTRATION: http://i-code.co.uk/javascript/imageviewer.php

Your help on this matter will be greatly appreciated!

Take care,

Jason

Last edited by Jason; 06-16-2009 at 11:56 AM..
Jason is offline   Reply With Quote