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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can anyone help me fix my code?

    My code used to work but suddenly stopped working and I have no idea why. It is javascript embedded in an html document.

    Code:
    <script language="JavaScript1.1">	
    
    var slideimages = new Array()
      var slidelinks = 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 gotoshow() {
      if (!window.winslide || winslide.closed)
        winslide = window.open(slidelinks[whichlink])
        else
        winslide.location = slidelinks[whichlink]
        winslide.focus()
      }
    
    </script>
    
    From body:
    
    <a href="javascript:gotoshow()"><img class="dropshadow"src="images/slideshow_1.gif" name="slide" border=0 width=240 height=180></a>
    					
    <script>	
    
    //configure the paths of the images, plus corresponding target links
    slideshowimages("images/slideshow_1.gif", "images/slideshow_2.gif", "images/slideshow_3.gif", "images/slideshow_4.gif", "images/slideshow_5.gif")
    
    //configure the speed of the slideshow, in miliseconds
    var slideshowspeed = 3000
    
    var whichlink = 0
    var whichimage = 0
    function slideit() {
      if (!document.images);
        return document.images.slide.src = slideimages[whichimage].src whichlink = whichimage
      if (whichimage < slideimages.length - 1);
        whichimage++else
        whichimage = 0 setTimeout("slideit()", slideshowspeed);
      }	
    slideit()
    					
    </script>
    Any help would be greatly appreciated.

  • #2
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts
    Code:
    if (!document.images);
        return document.images.slide.src = slideimages[whichimage].src whichlink = whichimage
      if (whichimage < slideimages.length - 1);
    The most obvious problem is the semicolons after the if clauses, which should not be there.


  •  

    Tags for this Thread

    Posting Permissions

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