I am having a small problem. I want to display a slideshow, but the images are not moving. When I check it in the console I get the error
Uncaught TypeError: object is not a function
Can someone please help me?
Here's my javascript code:
var step=1;
var images = [
"5c.jpg",
"5s.jpg",
"a65.jpg"
];
var slideshow = document.getElementById('slideshow');
function slide(){
slideshow.src = images[step];
if(step<3){
step++;
}
else
step=1;
setTimeout("slide()",2500);
}
and my html file:
<html>
<body>
<img src="C:\Users\M.OAN\Desktop\Pics\Slideshow\5c.jpg" alt="images" name="slide" id="slideshow" onload="slide();"/>
</body>
</html>