how to rotate the links using javascript?

Discussion in 'JavaScript' started by gdhanasekar, May 7, 2006.

  1. #1
    how to rotate the links using javascript?

    regards !!
    gdhanasekar
    http://www.webmaster-directory.net
     
    gdhanasekar, May 7, 2006 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    kk5st, May 8, 2006 IP
  3. -Abhishek-

    -Abhishek- Regaining my Momentum!

    Messages:
    2,109
    Likes Received:
    302
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What sort of Link rotation do you want ??
    On refresh or Text Box Rotation ??

    Check this Code ... simple one ;) Link Box rotation ...

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function makeArray(q){
    for(i=1 ; i < q ; i++){this[i]=0}}
    w=1;
    howmanysites=4; // Number of sites listed Below
    Sites = new makeArray(howmanysites);
    
    Sites[1] = "http://www.abhishektripathi.com|Abhishek's Blog!";
    //put yoursites then | and what you want the box to show here's where I got the orig.
    Sites[2] = "http://forums.digitalpoint,cin|The Best Forum!";
    Sites[3] = "http://www.secmate.com|Get PayPal Verified!";
    Sites[4] = "http://www.twinkhost.net|Free Hosting No Ads!";
    
    function showSites() {
    if (w > howmanysites) { w=1; };
    var string=Sites[w] + "";
    var split=string.indexOf("|");
    var url=string.substring(0,split);
    var word=string.substring(split + 1,string.length);
    document.form.url.value=url;
    document.form.word.value=word;
    w+=1;
    window.setTimeout('showSites()',1500);
    
    }
    function visitSite() {
    window.location=document.form.url.value;
    }
    // End -->
    </SCRIPT>
    </head>
    <BODY>
    <center>
    <form name=form>
    <table><tr><td align=center>
    <input type=hidden name=url value="">
    <input type=text name=word value="" onFocus="visitSite()" size=40>
    </td></tr></table>
    </form>
    </center>
    
    <script>
    showSites();
    </script>
    <P>
    Code (markup):
    Hope it helps ....
     
    -Abhishek-, May 8, 2006 IP
  4. -Abhishek-

    -Abhishek- Regaining my Momentum!

    Messages:
    2,109
    Likes Received:
    302
    Best Answers:
    0
    Trophy Points:
    0
    #4
    A quick Demo Here
    Abhishek
     
    -Abhishek-, May 8, 2006 IP