gast42: JavaScript setTimeOut

Beitrag lesen

<script type="text/javascript">

var b = new Array();

b[0] = new Image(); b[0].src = "3st_hnds.gif";
b[1] = new Image(); b[1].src = "3st_slpt.gif";
b[2] = new Image(); b[2].src = "3st_look.gif";
b[3] = new Image(); b[3].src = "3st_shak.gif";

var i = 0;

function Animation () {
   if (i > 3) i = 0;
   document.images[0].src = b[i].src;
   i++;;
   window.setTimeout("Animation()", 1000);
};

window.onload=Animation;
</script>