Forum Moderators: open

Message Too Old, No Replies

Random Image and Link?

         

Jae8201

9:06 pm on Jun 23, 2004 (gmt 0)

10+ Year Member



Hi,
Is there a free script out there that will do a Random Image, and allow me to have a specific link with each image? I have a nice random image script, but I am not sure how to put links to it. Any help is appreciated.

MichaelBluejay

10:07 pm on Jun 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




<HTML><HEAD>
<script language=javascript>
function randomizer() {
pics = new Array ('one.jpg','two.jpg','three.jpg');
links = new Array ('one.html','two.html','three.html');

whichItem = Math.floor(Math.random()*3);

document.write('<A href="' +links[whichItem]+ '"><IMG SRC="' +pics[whichItem]+ '"></A>');
}
</script>
</HEAD>
<BODY>
<script language=javascript>randomizer()</script>
</BODY></HTML>

Jae8201

11:22 pm on Jun 23, 2004 (gmt 0)

10+ Year Member



Awesome! Thanks for the help.