Previous Example-|-Next Example-|-Return to Chapter Listing

Example 14.3:
Moving Layers Around

[This example works with Netscape Navigator 4. It won't work with Netscape Navigator 2 or 3, or Internet Explorer 3.]

Use the buttons to move the layers left and right, up and down.

This text is in layer 1.


This text is in layer 1A.
Movement:


Here are our layers: <LAYER NAME="layer1" LEFT=360 TOP=176 BGCOLOR="#ffff00"><BR> <H1>This text is in layer 1.</H1><BR> <LAYER NAME="layer1A" LEFT=72 TOP=80 VISIBILITY=show BGCOLOR="#8888ff"> This text is in layer 1A. </LAYER> </LAYER> And this is how we moved them: <FORM NAME="layerForm"> <B>Movement:</B> <INPUT TYPE="button" VALUE=" Left " onclick="layers.layer1.left -= 10"> <INPUT TYPE="button" VALUE=" Right " onclick="layers.layer1.left += 10"> <INPUT TYPE="button" VALUE=" Up " onclick="layers.layer1.top -= 10"> <INPUT TYPE="button" VALUE=" Down " onclick="layers.layer1.top += 10"> </FORM>
Previous Example-|-Next Example-|-Return to Chapter Listing