Web Analytics Made Easy -
StatCounter Were can I find this Link Button Script!? - CodingForum

Announcement

Collapse
No announcement yet.

Were can I find this Link Button Script!?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Were can I find this Link Button Script!?

    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!

  • #2
    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">&nbsp;</div>

    </BODY></HTML>
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

    Comment


    • #3
      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!

      Comment

      Working...
      X