SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript For Rotating Banners

    What's a simple and good javascript for rotating banners?

  2. #2
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://builder.cnet.com/webbuilding/...7600.dir1.7602

    Try some of those. One of them is bound to do exactly what you want
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if you would call this simple, but here is one that has links associated with the banners and also displays a message in the status bar.
    <html>
    <head>
    <title>Rotating Banner Test</title>
    <script language="JavaScript1.1">
    <!--
    /*
    This script has been modified to rotate banners for my web site -- James R. Young
    A message will now display in the status bar for each banner and you when
    you click on a banner it does not open a new window it loads the site in the current window.
    JavaScript Image slideshow:
    By Website Abstraction (www.wsabstract.com)
    Over 200+ free JavaScript here!
    */
    var slideimages=new Array()
    var slidelinks=new Array()
    var slidestatus=new Array()
    function slideshowimages()
    {
    for (i=0;i<slideshowimages.arguments.length;i++)
    {
    slideimages[i]=new Image()
    slideimages[i].src=slideshowimages.arguments[i]
    }
    }

    function slideshowlinks()
    {
    for (i=0;i<slideshowlinks.arguments.length;i++)
    {
    slidelinks[i]=slideshowlinks.arguments[i]
    }
    }
    function slideshowstatus()
    {
    for (i=0;i<slideshowstatus.arguments.length;i++)
    {
    slidestatus[i]=slideshowstatus.arguments[i]
    }
    }

    slideshowimages("cdreq.gif","prohost.gif","waad5.gif","link2c.gif","ddlarge4.gif","alladvantage-ba2.gif")
    slideshowlinks("#","http://www.prohosting.com","http://www.wsabstract.com","http://www.123webmaster.com","http://www.dynamicdrive.com","http://www.alladvantage.com/go.asp?refid=fpb639")
    slideshowstatus("Hope you like my site!","Check out their hosting packages!","Great JavaScripts and Forums!","Great Webmaster resources!","Fantastic DHTML scripts!","Get paid for surfing!")
    //-->
    </script>
    <STYLE>
    A{text-decoration:none}
    A:link {color:slateblue}
    A:visited {colorrchid}
    </STYLE>
    </head>
    <body BGCOLOR="lightgreen" onLoad="window.status='Hope you like my site!'">
    <BR><BR><BR>
    <CENTER>
    <a href="#" onClick="location.href=slidelinks[whichlink]" ><img src="" name="slide" alt="Check out these greate sites!" border="0" width=468 height=60></a>
    </CENTER>
    <script>
    <!--
    var slideshowspeed=8000
    var whichlink=0
    var whichimage=0
    function slideit()
    {
    if (!document.images)
    {
    return
    }
    document.images.slide.src=slideimages[whichimage].src;
    var whichstatus=whichimage
    window.status=slidestatus[whichstatus];
    whichlink=whichimage
    if (whichimage<slideimages.length-1)
    {
    whichimage++
    }
    else
    {
    whichimage=0
    }
    setTimeout("slideit()",slideshowspeed)
    }
    slideit()
    //-->
    </script>
    </body>
    </html>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •