Example: | <script language="JavaScript">
<!-- //Purpose: Move bird1 in Netscape //Global: bird1x var bird2x = -150; ![]() function Move() { if (bird1x > document.width) bird1x = -150; document.bird1.left = bird1x++; //document.bird1.top = yPos; timerID = setTimeout("Move()", 25); } //--> </script> <body onload=Move()> <layer name="bird1" left=-150 top=300>
|
The parameters left, top, width and clip are in units of pixels.
When multiple layers are define, the last layer defined is on top. This can be over ridden with the above, below and Z-Index parameters.
The JavaScript properties for the layers object are: name (r), width (r), height (r), left (r/w), top (r/w), zIndex (r/w), visibility (r/w), clip.top (r/w), clip.left (r/w), clip.bottom (r/w), clip.right (r/w), clip.width (r/w),clip.height (r/w), background (r/w), bgcolor (r/w), siblingAbove (r), siblingBelow (r), above (r), below (r), parentLayer (r), layers (r) and src (r).
The JavaScript methods for the layers object are: offset(x,y), moveTo(x,y), resize(width,height), moveAbove(layer) and moveBelow(layer).
Return to HTML index
Example: | <script language="JavaScript">
<!-- //Purpose: Move bird2 in Internet Explorer //Global: bird2x var bird2x = -150; ![]()
<body onload=Move()> <div id="bird2" style="position:absolute;left:-150;top:300;">
|
Last Updated: $Date: 2002/02/18 02:26:14 $ GMT ($Revision: 1.9 $)