Maggie962: Gleiche JS-Script, funktioniert nur 1 mal. Bitte um Hilfe

Beitrag lesen

Ich brauche ein Bildwechsel Script mehrmals auf eine Seite.

Aber nur das erste Script funktioniert. Habe schon überall gesucht, leider nichts gefunden.
Vielleicht könnt Ihr helfen.

Vielen Dank im Voraus.
------------------------

<html>

<head><title>Test</title>
</head>

<body>
<div align="center">

<div>

<a href="index.html">

<img src="images/flower/100_small.jpg" width="200" height="100" alt="flower"></a>

<script type="text/javascript">
var b = new Array();
b[0] = new Image(); b[0].src = "images/flower/101_small.jpg";
b[1] = new Image(); b[1].src = "images/flower/102_small.jpg";
b[2] = new Image(); b[2].src = "images/flower/103_small.jpg";
b[3] = new Image(); b[3].src = "images/flower/100_small.jpg";
var i = 0;
function Animation () {
  if (i > 3)
    i = 0;
  document.images[0].src = b[i].src;
  i = i + 1;
  window.setTimeout("Animation()", 1000);
}

window.setTimeout("Animation()", 1000);
</script>

</div>

<div>

<img src="images/flower/104_small.jpg" width="200" height="100" alt="Flower2">

<script type="text/javascript">
var c = new Array();
c[0] = new Image(); c[0].src = "images/flower/105_small.jpg";
c[1] = new Image(); c[1].src = "images/flower/106_small.jpg";
c[2] = new Image(); c[2].src = "images/flower/107_small.jpg";
c[3] = new Image(); c[3].src = "images/flower/104_small.jpg";
var i = 0;
function Animation () {
  if (i > 3)
    i = 0;
  document.images[0].src = c[i].src;
  i = i + 1;
  window.setTimeout("Animation()", 1000);
}

window.setTimeout("Animation()", 1000);
</script>

</div>

</div>
</body></html>