View Full Version : Were can I find this Link Button Script!?
DragonTGK
02-22-2004, 06:56 AM
Sup, I've been looking all over for a (javascript? ; dhtml?) script that will randomize between, lets say 10 images and there corsponding links (so like 88x31 buttons) and will display a number of them on a page. Everytime you reload the page it changes (randomizes) them. Anyone no of something like this thats really easy to configure, ect? Thanks!
See if the following helps you out
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
<script>
<!--
mylink=new Array()
mylink[mylink.length]="<A href='#null'><img src='pic01.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic02.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic03.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic04.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic05.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic06.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic07.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic08.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic09.jpg'></a>"
mylink[mylink.length]="<A href='#null'><img src='pic10.jpg'></a>"
function init(){
count=5 // how many to display
selected=""
list=new Array()
maxnum=mylink.length
if(count>maxnum){
count=maxnum
}
for(n=0;n<maxnum;n++){
list[n]=n
}
for(p=0;p<count;p++){
rndnum=Math.round(Math.random()*maxnum-1)
chosen_num=list.splice(rndnum,1)
maxnum--
selected+=mylink[chosen_num]
document.getElementById("link_list").innerHTML=selected
}
}
// -->
</script>
</HEAD>
<BODY onload="init()">
<div id="link_list"> </div>
</BODY></HTML>
DragonTGK
02-22-2004, 06:03 PM
I havn't tired that yet, but I just looked at it and it looks pretty much like what I've been looking for! Thanks!
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.