Jump to content

javascript help


Francis Coquelin

Recommended Posts

<head><script type="text/javascript"><!--var image1=new Image() // load all images as variablesimg src="Images/desktop1.JPG" // first imagevar image2=new Image()img src="Images/laptop1.jpg" // second imagevar image3=new Image()img src="Images/router1.jpg" // third imagevar image4=new Image()img src="Images/ram1.jpg"  // fourth imagevar image5=new Image()img src="Images/speaker1.jpg" // fifth  image</head>//--></script><body><img src="desktop1.JPG" name="slide" width="100" height="56" /> <!-- insert first image --><script><!--//variable that will increment through the imagesvar step=1function slideit(){//if browser does not support the image object, exit.if (!document.images)returndocument.images.slide.src=eval("image"+step+".src") // run the slideshowif (step<3) // count which image to show nextstep++elsestep=1//call function "slideit()" every 2.5 secondssetTimeout("slideit()",2500) // wait 2.5 seconds}slideit() // change to the next image//--></script></body>

only the first image is visiblewhat am i doing wrong?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...