PDA

View Full Version : multiple random code and link



mattunder
09 Sep 2010, 01:11 PM
I am trying to have a random background image (set of large images)... but also a random image (different set of small images) within a table. It currently works... i guess my question is, for the small image, can I make it not be a LINK at all... I currently have it set to reload it's own page. I tried entering "#" as the link... but it loads to an error page. I have tried deleting the link code, but it removes the image altogether. All the source code should be visible. Website link is http://www.mattunderwood.net/v2/homepage7.htm

Here is the small image random code. Thanks.


<script language="JavaScript">
<!--


function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="img/in1.jpg"
myimages[2]="img/in2.jpg"
myimages[3]="img/in3.jpg"
myimages[4]="img/in4.jpg"
myimages[5]="img/in5.jpg"
myimages[6]="img/in6.jpg"



//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://www.mattunderwood.net/v2/homepage7.htm"
imagelinks[2]="http://www.mattunderwood.net/v2/homepage7.htm"
imagelinks[3]="http://www.mattunderwood.net/v2/homepage7.htm"
imagelinks[4]="http://www.mattunderwood.net/v2/homepage7.htm"
imagelinks[5]="http://www.mattunderwood.net/v2/homepage7.htm"
imagelinks[6]="http://www.mattunderwood.net/v2/homepage7.htm"


var ry=Math.floor(Math.random()*myimages.length)

if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}

random_imglink()
//-->
</script>