<html>
<head>
<script>
var imageRefs = ["pict1.png","pict2.png","pict3.png"];
var counter = 0;
(function changeImage(){
image = document.getElementById("image1");
if(image != null) {
image.src = imageRefs[counter];
counter = (counter + 1) % 3;
}
setTimeout(changeImage,2000);
})();
</script>
</head>
<body>
<img id="image1" src="pict1.png" />
</body>
</html>
Here is the working example:
Žádné komentáře:
Okomentovat