Fuelednrdy
05-15-2011, 07:11 PM
Pretty simple, I'm trying to me a slide show for my website (face in, 2.5 seconds later, fade out and move to the next one). I have a problem, I have tried everything to try and get the code working but I don't have a clue what the problem is.
Anyone tell me if you can spot any errors? I have managed to get the image to appear on my page but won't start the slide.
<html>
<body>
<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="Images\double.jpg"
var image2=new Image()
image2.src="Images\family.jpg"
var image3=new Image()
image3.src="Images\room.jpg"
//-->
</script>
</head>
<body>
<center><img src="Images\double.jpg" name="slide" width="500" height="456" /></center>
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 1.0 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
</body>
</html>
Anyone tell me if you can spot any errors? I have managed to get the image to appear on my page but won't start the slide.
<html>
<body>
<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="Images\double.jpg"
var image2=new Image()
image2.src="Images\family.jpg"
var image3=new Image()
image3.src="Images\room.jpg"
//-->
</script>
</head>
<body>
<center><img src="Images\double.jpg" name="slide" width="500" height="456" /></center>
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 1.0 seconds
setTimeout("slideit()",2500)
}
slideit()
//-->
</script>
</body>
</html>