Layer.top

JavaScript 1.2+ Nav4+ Syntax

							layer.top

Description

The top property of the Layer object represents the y-coordinate position of the layer relative to the top-level document. Increasing or decreasing this value can move the layer object up or down.

Example

Listing 7.355 uses the top property to move the layer up. When the button is clicked, the move() function is executed, which will move the layer up by 10 pixels.

Listing 7.355 Example of the top Property
<html>
<head>
<title> Using the top property of the Layer object</title>
</head>
<body>

<script language="JavaScript">
<!-- Hide
function move(){
     document.layer1.top = document.layer1.top - 10;
}
// End Hide --->
</script>
							 <layer id="layer1" width=200 height=200 color= ...

Get Pure JavaScript 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.