PDA

View Full Version : Thumbnail photo gallery help


JVRudnick
10-11-2002, 06:34 PM
Hello all...

Right now, I'm using thumbnails on a web page, that when clicked, open up a new window to show the image. The thing is, if there are 35 pix on the page, I gotta type the same dang thing 35 times. Even cut/paste don't help... here's what I'm using in a table...


<td><a href="javascript:newWindow('images/pix/Camera Picture 14.JPG')"><img src="images/pix/Camera Picture 14.JPG" width="100" border=0 alt=""></a></td>

with this as the script item...

<script language=Javascript type="text/Javascript">

function newWindow(fishStory) {

fishWindow = window.open(fishStory, 'fishWin', 'toolbar=no, location=no, scrollbars=no, width=440, height=330, top=80, left=120')
fishWindow.focus()
}
</script>

(dont ask about the fish theme either!)



Is there a way, to create a 'global' javascript that will work with this thumbnail gallery idea....or am I destined to always have to type out the same stuff item by item?

Jim

Roy Sinclair
10-11-2002, 06:42 PM
The script is already usable from multiple sources so you only have to copy and change the table entries for the rest of the images.

JVRudnick
10-11-2002, 07:02 PM
Umm....that's what I don't want to do.

Is there any other way than for me to type in the 35 different sets of items?

That is, a labour-saving way?

Jim

Roy Sinclair
10-11-2002, 08:41 PM
You can use a Javascript array to contain the image file names and then more javascript to write the table rows. This would save you a little time if you expect to update the images on the page frequently by bringing them all together in one place. But for a single page that's not going to see much in the way of changes in it's lifetime it's simpler to just key it all than it would be to work out the script to generate those lines.