0 Replies Latest reply on Mar 30, 2010 8:37 PM by Nelson M

    debug a js slide show

    Nelson M

      I pasted this into my website hoping to get the banners to rotate. I found the script on javascriptkit.com

       

      In the head section I have this code.


      <SCRIPT LANGUAGE="JavaScript">
      <!--
      //set image paths
      src = ["images/banner1.jpg", "images/banner2.jpg", "images/banner3.jpg", "images/banner4.jpg", "images/banner5.jpg", "images/banner6.jpg", "images/banner7.jpg"]

       


      //set duration for each image
      duration=4;

       

      //Please do not edit below
      ads=[]; ct=0;
      function switchAd() {
      var n=(ct+1)%src.length;
      if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
      document["Ad_Image"].src = ads[ct=n].src;
      }
      ads[n=(ct+1)%src.length] = new Image;
      ads[n].src = src[n];
      setTimeout("switchAd()",duration*1000);
      }
      function doLink(){
      location.href = url[ct];
      } onload = function(){
      if (document.images)
      switchAd();
      }
      //-->
      </SCRIPT>

       

      In the body, I have this code.

       

      <A HREF="javascript:doLink();" onMouseOver="status=url[ct];return true;"
      onMouseOut="status=''"><IMG NAME="Ad_Image" SRC="images/banner1.jpg" BORDER=0></A>

       

       

       

      I don't need to add URL for mouse clicks so I took out the code  that goes to URL's.

       

      Anyway I can't get the images to rotate. Is there something I am missing. I have CS3 on a MAC and no nothing about coding websites. Here is my site www.relaxandeat.com

       

      Cheers.