<html> |
<script> |
var state=0; |
// intializes animation timer |
function ini() { |
setInterval("periodic()",500); |
} |
// called regularly to perform animation |
function periodic() { |
state = (state+1)%7; |
animState=state+1; |
// draw each state (except last one in which we make some pause) |
if (animState <= 5) |
document.getElementById("im").src="img/anim"+ animState +".jpg"; |
} |
|
</script> |
<body onLoad="ini()"> |
<h1>Letters & Numbers</h1> |
<center> |
<img id="im" src="img/anim1.jpg"/> |
</center> |
</body> |
</html> |