Is there a better way to repeat a function infinite times?
Rather than using:
setTimeout(myfunction(), 10)
How would I add that into this? When I replaced setTimeout it went weird with the order.
<img id="slideshow" src="4.JPG" alt="cheese" width="264" height="264"/>
<script>
source=["1.jpg", "2.JPG", "3.JPG", "4.JPG"];
var i=0
function show(){
document.getElementById("slideshow").src = source[i];
if (i<source.length - 1)
i++
else
i=0
setTimeout("show()",2500)
}
show()
</script>