Nice links switcher - How is it called?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kerberos

    #1

    Nice links switcher - How is it called?

    I found an interesting "menu", I don't know how you call it. It displays a
    link for 2 seconds, then it displays another link for 2 seconds, and so
    on. Here it is: http://www.alibaba.com under "Browse Trade Leads".

    I found that it doesn't work with major browsers (If you try it, please
    use IE, as it works only on IE, sorry).
    Do you know a JavaScript that does just that but is cross-browser?
    Thanks,

    --

    Kerberos.

    Faster, safer and smarter than default browsers. Fully-featured for privacy, security, and so much more. Get the faster, better Opera browser for free.


    http://www.auriance.com


  • Robert

    #2
    Re: Nice links switcher - How is it called?

    >It displays a link for 2 seconds, then it[color=blue]
    >displays another link for 2 seconds, and so on.[/color]

    Try this html file. Let me know if you have any questions.

    I didn't actually a changing link in the site you mentioned. Maybe the
    links don't change on a Mac. So, I am guessing here!



    Robert

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Changi ng Links</title>

    <script type="text/javascript">
    function changeLink(labe l)
    {
    links = [ "<a href='http://www.yahoo.com'> Yahoo</a>",
    "<a href='http://www.google.com' >Google</a>",
    "<a href='http://www.ebay.com'>E bay</a>" ];
    var node;

    // Set a starting index for the links array
    if ( typeof changeLink.inde x == "undefined" )
    { changeLink.inde x = 0; }

    if (document.getEl ementById)
    {
    node = document.getEle mentById(label) ;
    if (node)
    {
    newLink(node);
    }
    else
    {
    alert("You need to create a span tag with " +

    "the id of " + label + ".");
    return;
    }
    }
    else
    {
    if (document.all)
    {
    node = document.all[label];
    newLink(node);
    }
    else
    {
    alert("Construc ts document.getEle mentByID " +
    "and document.all failed. " +
    "You need to use a newer browser.");
    return;
    }
    }

    function newLink(node)
    {
    node.innerHTML = links[changeLink.inde x++];
    changeLink.inde x %= links.length;

    setTimeout("cha ngeLink('newlin k')",3000);
    }

    }
    </script>
    </head>
    <body>
    <p>Change a link.</p>
    <span id="newlink">< a
    href="http://www.apple.com"> Apple</a></span>
    <br>
    <p>When the "Change links" button is
    pressed, the link will change every three seconds.
    <form>
    <input type="button"
    name="activate"
    value="Change links"
    onclick="change Link('newlink') ">
    </form>
    </p>
    </body>
    </html>

    Comment

    Working...