SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error message in rotating pic script

    This is the code for an HTML document which allows me to have a nifty little rotating pic gallery. It's great - but it gives me this little error message at the bottom. I've been thru the code a million times and am still scratching my head as to what is causing the error. Thanks a ton for any help!


    Code:
    <html>
    <head>
    <title></title>
    <script>
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    // NS4-6,IE4-6
    // Fade effect only in IE; degrades gracefully
    
    // =======================================
    // set the following variables
    // =======================================
    
    // Set slideShowSpeed (milliseconds)
    var slideShowSpeed = 3000
    
    // Duration of crossfade (seconds)
    var crossFadeDuration = 1
    
    // Specify the image files
    var Pic = new Array() // don't touch this
    // to add more images, just continue
    // the pattern, adding to the array below
    
    Pic[0] = 'm1a.jpg'
    Pic[1] = 'm2a.jpg'
    Pic[2] = 'm3a.jpg'
    Pic[3] = 'm4a.jpg'
    Pic[4] = 'm5a.jpg'
    
    // =======================================
    // do not edit anything below this line
    // =======================================
    
    var t
    var j = 0
    var p = Pic.length
    
    var preLoad = new Array()
    for (i = 0; i < p; i++){
       preLoad[i] = new Image()
       preLoad[i].src = Pic[i]
    }
    
    function runSlideShow(){
       if (document.all){
          document.images.SlideShow.style.filter="blendTrans(duration=2)"
          document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
          document.images.SlideShow.filters.blendTrans.Apply()      
       }
       document.images.SlideShow.src = preLoad[j].src
       if (document.all){
          document.images.SlideShow.filters.blendTrans.Play()
       }
       j = j + 1
       if (j > (p-1)) j=0
       t = setTimeout('runSlideShow()', slideShowSpeed)
    }
    </script>
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body onload="runSlideShow()"text="#000000" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000" bgcolor="#FFFFFF" background="Untitled-900.gif">
    <script>runSlideShow();</script>
    
    
    
    <table width="267" border="0" cellspacing="1" cellpadding="1" height="410" align="center">
      <tr> 
        <td valign="top" height="53"> 
          <div align="center"> </div>
          <div align="center"><img src="m1a.jpg" name='SlideShow' width=267 height=410 border="0"></div>
        </td>
      </tr>
    </table>
    </BODY>
    
    </HTML>

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What is the error? I'm guessing it's that you're calling runSlideshow() twice. Get rid of this:
    Code:
    <script>runSlideShow();</script>
    If that doesn't help, explain what the error is.

    Also, that <table> is unnecessary for what you're doing. You only need a single div. Also, you should get a DOCTYPE.

  3. #3
    SitePoint Member
    Join Date
    May 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    removing that script solved it. How obviously easy. I'm an airhead. Thanks!!!


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
  •