O'Reilly logo

JavaScript Pocket Reference, 2nd Edition by David Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Layer

Synopsis

document.layers[i]
document.layers[layer-name]
document.layer-name

Constructor

new Layer(width, parent_layer)

Description

The Layer object is supported only in Netscape 4 and was discontinued in Netscape 6. It is entirely non-standard, but is documented here because it provides the only way to work with dynamically positioned objects in Netscape 4. Any HTML element with a CSS position attribute of absolute is represented by a Layer object in JavaScript. You can also create layers with the non-standard <layer> tag, or with the Layer( ) constructor.

Properties

above

The layer above this one, if any. Read-only.

background

The background image of the layer.

below

The layer below this one, if any. Read-only.

bgColor

The background color of the layer.

clip.bottom

The Y-coordinate of the bottom edge of the layer’s clipping area, relative to top.

clip.height

The height of the layer’s clipping area. Setting this property also sets the value of clip.bottom.

clip.left

The X-coordinate of the left edge of the layer’s clipping area, relative to left.

clip.right

The X-coordinate of the right edge of the layer’s clipping area, relative to left.

clip.top

The Y-coordinate of the top edge of the layer’s clipping area, relative to top.

clip.width

The width of the layer’s clipping area. Setting this property also sets the value of clip.right.

document

A read-only reference to the Document object contained within the layer.

hidden

Specifies whether a layer is hidden or visible. Setting this property to true hides ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required