Im tryin to create an image rotator where an image will change every 3 seconds.But the problem is, images aren't showing up. Here is my code:
<html>
<script type='text/javascript'>
var myScreen=document.getElementById("banner");
var pictures=['stephIrv.jpg','pintball.jpg','badminton.jpg','running.jpg','boxing.jpg'];
var ttlPics = pictures.length;
var i=0;
function slideShow()
{
if(i > (ttlPics - 1))
{
i=0;
}
myScreen.innerHTML = '<img src="'+pictures[i]+'">';
i++;
loopTimer = setTimeout(slideShow,3000);
}
slideShow();
</script>
<body>
<div id = 'banner'></div>
</body>
</html>
setTimeouthas to be a variable not a string. You don't have aloopfunction declared anywhere either.