SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rotating Banner and Links

    I created a rotating banner in FrontPage. The banner presently has 5 different pictures to show. I want each picture to link to a different page.

    It should be easy to do in FrontPage but of course, nothing works all that well in FrontPage, so when I try to do this it puts the same link in for each and every picture.

    I figured I could just go into the html coding and manually put in the link commands. I went to a rotating banner tutorial which didn't explain very clearly. It said to put the links in between the " " marks. When I did this according what I thought I was supposed to do, it didn't work. What I presently put in isn't working either. So it's obviously wrong.

    Not every picture in the banner needs a link yet. I want the EliteBB.JPG to link to ExxonOrderPg.htm

    and the AdvertiseinSpace.JPG picture to link to the
    advertise.htm

    Here is the code as it presently stands. What simple thing am I doing wrong?

    <applet code="fprotate.class" codebase="./" width="393" height="183">
    <param name="rotatoreffect" value="dissolve">
    <param name="time" value="5">

    <param name="image1" valuetype="ref" value="EmCadBillboard.JPG">
    <param name="image2" valuetype="ref" value="PristBB.JPG">
    <param name="image3" valuetype="ref" value="AdvertiseinSpace.JPG">
    <param name="image4" valuetype="ref" value="BPBB.JPG">
    <a "http://www.northbaytechnologies.com/ExxonOrderPg.htm">
    <param name="image5" valuetype="ref" value="EliteBB.JPG">
    </applet>

    To view the uploaded page go to http://www.northbaytechnologies.com. The banner is the one on the bottom right hand side.


    BTW, the more I try to work in FrontPage, the more I hate Microsoft. Ready to switch to DreamWeaver.

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, being that it's a banner, I didn't want to create lots of global variables, so this simple little banner uses just 1.
    Code:
    <html>
    <head>
    <title>Rotating Banner</title>
    <script>
    var b = new Object();
    b.imgRoot = "images/banners"; // Root path for banner images
    b.i = 0;
    b.delay = 5; // In seconds
    b.bannerData = [
    	['banner1.gif','www.google.com'],
    	['banner2.gif','www.sitepointforums.com'],
    	['banner3.gif','msdn.microsoft.com'],
    	['banner4.gif','www.mozilla.org/docs/dom/domref/dom_shortTOC.html']
    	];
    
    function swapBanner() {
    	if (b.i == b.bannerData.length) b.i = 0;
    	var a = document.getElementById('bannerLink');
    	a.href = "http://" + b.bannerData[b.i][1];
    	a.firstChild.src = b.imgRoot + b.bannerData[b.i++][0];
    	var t = setTimeout("swapBanner()",b.delay*1000);
    	}
    
    </script>
    </head>
    
    <body onLoad="swapBanner();">
    <a href="" id="bannerLink"><img></a>
    </body>
    </html>
    Last edited by beetle; Oct 4, 2002 at 13:09.
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev





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
  •