tommy: stufenweises layer-clipping

Beitrag lesen

hi forum!

ich möchte bei einem layer schrittweise das clipping ändern. mit dem script unten sollte es funktionieren, und das script läuft auch ab, aber leider schert das den layer überhaupt nicht. was mache ich falsch?

danke im vorraus, tommy

<head>
<script language="JavaScript">

clipTop = 0;
clipRight = 100;
clipLeft = 0;
clipBottom = 200;
timer = null;

function setClip() {

clipLayer = document.getElementById('clipLay').style;
 clipLayer.clip.top = clipTop;
 clipLayer.clip.right = clipRight;
 clipLayer.clip.left = clipLeft;
 clipLayer.clip.bottom = clipBottom;

if(clipRight < 300) {
  clipTop = 0;
  clipRight += 10;
  clipLeft = clipLeft;
  clipBottom = 0;
  clipLayer.clip = 'rect(' +clipTop+ ',' +clipRight+',' +clipBottom+ ',' +clipLeft+ ')';
  setTimeout('setClip()', 400);
  document.form.field1.value='rect(' +clipTop+ ',' +clipRight+',' +clipBottom+ ',' +clipLeft+ ')';
 }
}
</script>

<style>
#clipLay {height=200;width=400;background-color:#c0c0c0;}
</style>

</head>

<body onload="setClip();">

<div id="clipLay">
blablabla<p>
blablabla<p>
blablabla<p>
blablabla<p>
blablabla<p>
</div>

<form name="form">
<input type=text name=field1><br>
<input type=text name=field2>
</form>