Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can someone help quick

    I am trying to cycle these images but I cannot figure out whats wrong. Help would be greatly appreciated.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
    <title>Banner Cycler</title>
    <script type="text/javascript">
    <!-- HIDE FROM INCOMPATIBLE BROWSERS
     var curBanner="adImage1";
     var changeBanner;
     function changeAds() {
        if (curBanner == "adImage2") 
             document.this.src="adImage2.gif";
             curBanner="adImage2";
        if (curBanner =="adImage3") 
             document.this.src="adImage4.gif";
             curBanner="adImage4";
        if (curBanner == "adImage4") 
             document.this.src="adImage5.gif";
             curBanner="adImage5";
        if (curBanner=="adImage5")
           document.this.src=adImage1.gif";
           curBanner="adImage1";
           }
    
    // STOP HIDING FROM INCOMPATIBLE BROWSERS -->
    </script>
    </head>
    
    <body onload="var changeBanner=setInterval('changeAds()',5000);">
    <p><img src="adImage1.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage2.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage3.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage4.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage5.gif" name="banner" alt="Cycling Banners" /></p>
    </body>
    </html>

  • #2
    Regular Coder ninnypants's Avatar
    Join Date
    Apr 2008
    Location
    Utah
    Posts
    504
    Thanks
    10
    Thanked 47 Times in 47 Posts
    Try this code that I have from and earlier post

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VoSs View Post
    I am trying to cycle these images but I cannot figure out whats wrong. Help would be greatly appreciated.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE html PUBLIC 
    "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
    <title>Banner Cycler</title>
    <script type="text/javascript">
    <!-- HIDE FROM INCOMPATIBLE BROWSERS
     var curBanner="adImage1";
     var changeBanner;
     function changeAds() {
        if (curBanner == "adImage2") 
             document.this.src="adImage2.gif";
             curBanner="adImage2";
        if (curBanner =="adImage3") 
             document.this.src="adImage4.gif";
             curBanner="adImage4";
        if (curBanner == "adImage4") 
             document.this.src="adImage5.gif";
             curBanner="adImage5";
        if (curBanner=="adImage5")
           document.this.src=adImage1.gif";
           curBanner="adImage1";
           }
    
    // STOP HIDING FROM INCOMPATIBLE BROWSERS -->
    </script>
    </head>
    
    <body onload="var changeBanner=setInterval('changeAds()',5000);">
    <p><img src="adImage1.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage2.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage3.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage4.gif" name="banner" alt="Cycling Banners" /></p>
    <p><img src="adImage5.gif" name="banner" alt="Cycling Banners" /></p>
    </body>
    </html>
    --------------------------------------------------------------------------

    Try the code below:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <html>
    <head>
    <title>Cycling Banner</title>

    <script type="text/javascript">
    <!--

    var curBanner="image1";

    function changeBanner()
    {

    if (curBanner == "image2")
    {
    document.images[0].src = "adImage1.gif";
    curBanner = "image1";
    }
    else if (curBanner == "image3")
    {
    document.images[0].src = "adImage2.gif";
    curBanner = "image2";
    }
    else if (curBanner == "image4")
    {
    document.images[0].src = "adImage3.gif";
    curBanner = "image3";
    }
    else if (curBanner == "image5")
    {
    document.images[0].src = "adImage4.gif";
    curBanner = "image4";
    }
    else
    {
    document.images[0].src = "adImage5.gif";
    curBanner = "image5";
    }

    }


    -->
    </script>

    <style type="text/css">

    body {
    background:#FFFFFF;
    color:#000000;
    }
    </style>


    </head>

    <body onload="var begin=setInterval('changeBanner()',5000);">

    <p><img src="adImage1.gif" id="adBanner" alt="Ad Banner" /> </p>

    </body>

    </html>


  •  

    Posting Permissions

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