Randomise Thumbnails

  ikle_pixie 22:38 09 Apr 05

On the home page of my website i have 5 thumbnails which lead you to different sections of the site. I would like to have those thumbnails change each time the page is refreshed.

Does anyone have an ideas how?


click here

  Charence 02:23 10 Apr 05

Here's some code :o)





<!-- Begin

var a = Math.random() + ""

var rand1 = a.charAt(5)

images = new Array

images[1] = "CharenceName3DUK1"

images[2] = "CharenceName3DUK2"

images[3] = "CharenceName3DUK3"

images[4] = "CharenceName3DUK4"

images[5] = "CharenceName3DUK5"

images[6] = "CharenceName3DUK6"

images[7] = "CharenceName3DUK1"

images[8] = "CharenceName3DUK2"

images[9] = "CharenceName3DUK3"

images[0] = "CharenceName3DUK0"

var image = images[rand1]

document.write("<img src=" + image + ".jpg>");

// End -->





Currently the code above can have 10 random images, this may be altered. Also where it says "CharenceNameUK3D" is the filename of the image.

click here for working example.


  ikle_pixie 02:26 10 Apr 05

yay! thank you...

will give it a go

This thread is now locked and can not be replied to.

Apple Event as it happened | Apple October Event live blog: Apple unveils new MacBook Pro at…

1995-2015: How technology has changed the world in 20 years

Graeme Messer's exhibition aims to challenge fears and insecurities

New MacBook Pro release date, price and specs | New MacBook Pro 2016 announced: Now with Touch Bar…