We help IT Professionals succeed at work.
Get Started

animated image slideshow

unnameduser
unnameduser asked
on
334 Views
Last Modified: 2012-05-09
I am messing around with a javascript slideshow and want to animate it.  What code should i add to the  following


<html>
<head>
<script type="text/javascript">
<!--
var image1=new Image()
image1.src="image1.jpg"
var image2=new Image()
image2.src="image2.jpg"
var image3=new Image()
image3.src="image3.jpg"
var image4=new Image()
image4.src="image4.jpg"
var image5=new Image()
image5.src="image5.jpg"
var image6=new Image()
image6.src="image6.jpg"
var image7=new Image()
image7.src="image7.jpg"
var image8=new Image()
image8.src="image8.gif"

//-->
</script>
</head>
<body>
<body>
<img src="image1.jpg" name="slide" width=650 height=300>
<script type="text/javascript">
<!--
//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<8)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}
slideit()
function slidelink(){
if (whichimage==1)
window.location="#"
else if (whichimage==2)
window.location="#"
else if (whichimage==3)
window.location="#"
}

//-->
</script>
</body>
</body>
</html>

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE