Example

Listing 8.252 uses the clip.top property to shorten the height of the layer. Two layers are created using the <layer> tag. When the button is clicked, the clip1() function is called, which clips the top of layer1 by 88 pixels.

Listing 8.252 Example of the clip.top Property

<html><body><script type="text/javascript" language="JavaScript"><!--// function clips the top of layer 1 by 88 pixels.function clip1(){     document.layer1.clip.top = 88;}// --></script><layer id="layer1" width="200" height="200" bgcolor="yellow" top="170"left="200" visibility="show"><center>Layer 1</center></layer><layer id="layer2" width="150" height="160" bgcolor="green" top="100"left="70" visibility="show"><center>Layer 2</center></layer><form name="form1"><input type="button" value="Clip Top of Layer 1" onClick='clip1()'> ...

Get Pure JavaScript, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.