Hanniball: Layer in MS Explorer verschieben

Beitrag lesen

Ich habe das script so weit das ich jetzt in eine Richtung den Kasten bewege doch wie bewege ich ihn zurueck wenn er 200 Pixel erreicht hat?

<script language="JScript" type="text/jscript">
var x = 0;
function move()
{
 document.all.box1.style.right = x;
 if (x <= 200){
  x = (x + 1);
  if (x == 199){
  moveback()
  }
 }
 window.setTimeout("move()",10);
}
function moveback()
{
 document.all.box1.style.right = x;
 if (x > 0){
  x = (x - 1);
  if (x == 1){
  move()
  }
 }
 window.setTimeout("moveback()",40);
}
</script>

Gruss

Hanniball