Layer : Object

Layer in an HTML document.

Browser/User Agent Support

IEMozillaNetscapeOperaSafari
nono4.0+nono

Constructors

ConstructorIEMozillaNetscapeOperaSafari
Creates a new instance of a Layer object.
nono4.0+nono
 

Properties

PropertyIEMozillaNetscapeOperaSafari
Layer object directly above the current layer in the z-index order.
nono4.0+nono
 
Image displayed in the background of the layer.
nono4.0+nono
 
Layer object directly below the current layer in the z-index order.
nono4.0+nono
 
Background color of the layer.
nono4.0+nono
 
Bottom edge of the clipping area of the layer, relative to layer.top.
nono4.0+nono
 
Height of the clipping area of the layer.
nono4.0+nono
 
Left edge of the clipping area of the layer, relative to layer.left.
nono4.0+nono
 
Right edge of the clipping area of the layer, relative to layer.right.
nono4.0+nono
 
Top edge of the clipping area of the layer, relative to layer.top.
nono4.0+nono
 
Width of the clipping area of the layer.
nono4.0+nono
 
Document associated with the layer.
nono4.0+nono
 
Specifies whether a layer is hidden (true) or visible (false).
nono4.0+nono
 
Array of child layers of the current layer.
nono4.0+nono
 
Horizontal position (in pixels) of the left edge of the layer.
nono4.0+nono
 
Name of the layer.
nono4.0+nono
 
Horizontal position (in pixels) of the layer relative to the page.
nono4.0+nono
 
Vertical position (in pixels) of the layer relative to the page.
nono4.0+nono
 
Parent layer of the current layer.
nono4.0+nono
 
Layer object directly above the current layer in the z-index order that shares the same parent as the current layer.
nono4.0+nono
 
Layer object directly below the current layer in the z-index order that shares the same parent as the current layer.
nono4.0+nono
 
URL for the contents of the layer.
4.0+nononono
 
Vertical position (in pixels) of the top edge of the layer.
nono4.0+nono
 
Specifies whether the layer should be visible ("show"), hidden ("hide"), or inherit the visibility of the parent layer ("inherit").
 
Window or frame object that contains the layer.
nono4.0+nono
 
Horizontal position (in pixels) of the left edge of the layer.
nono4.0+nono
 
Vertical position (in pixels) of the top edge of the layer.
nono4.0+nono
 
Position of the layer in the z-order, relative to its sibling layers.
nono4.0+nono
 

Methods

MethodIEMozillaNetscapeOperaSafari
Sets the layer to capture all events of a specified type.
nono4.0+nono
 
Calls the event handler for the specified event.
nono4.0+nono
 
Loads contents into the layer and updates the width of the layer.
nono4.0+nono
 
Moves the current layer above another layer.
nono4.0+nono
 
Moves the current layer below another layer.
nono4.0+nono
 
Moves the layer the specified amount down and to the right.
nono4.0+nono
 
Moves the layer to a specified position relative to the document or parent layer.
nono4.0+nono
 
Moves the layer to a specified position on the page.
nono4.0+nono
 
Moves a layer down and to the right by a specified amount. Deprecated by moveBy().
nono4.0+nono
 
Sets the layer to release all captured events of a specified type.
nono4.0+nono
 
Resize the layer by the specified amount.
nono4.0+nono
 
Resize the layer to a specified size.
nono4.0+nono
 
Routes a captured event through the event hierarchy.
nono4.0+nono
 

References

Window

Availability

Netscape 4 only | discontinued in Netscape 6

Constructor Detail

Layer Layer()

Creates a new instance of a Layer object.

Visibility
internal

Property Detail

Object above

Layer object directly above the current layer in the z-index order.

Object background

Image displayed in the background of the layer.

Object below

Layer object directly below the current layer in the z-index order.

String bgColor

Background color of the layer.

Object clip.bottom

Bottom edge of the clipping area of the layer, relative to layer.top.

See Also

layer.top

Object clip.height

Height of the clipping area of the layer.

See Also

layer.clip.bottom

Object clip.left

Left edge of the clipping area of the layer, relative to layer.left.

See Also

layer.left

Object clip.right

Right edge of the clipping area of the layer, relative to layer.right.

Object clip.top

Top edge of the clipping area of the layer, relative to layer.top.

See Also

layer.top

Object clip.width

Width of the clipping area of the layer.

Object document

Document associated with the layer.

Boolean hidden

Specifies whether a layer is hidden (true) or visible (false).

Array layers

Array of child layers of the current layer.

Number left

Horizontal position (in pixels) of the left edge of the layer.

String name

Name of the layer.

Number pageX

Horizontal position (in pixels) of the layer relative to the page.

Number  pageY

Vertical position (in pixels) of the layer relative to the page.

Object parentLayer

Parent layer of the current layer.

Object siblingAbove

Layer object directly above the current layer in the z-index order that shares the same parent as the current layer.

Object siblingBelow

Layer object directly below the current layer in the z-index order that shares the same parent as the current layer.

String src

URL for the contents of the layer.

Number top

Vertical position (in pixels) of the top edge of the layer.

String visibility

Specifies whether the layer should be visible ("show"), hidden ("hide"), or inherit the visibility of the parent layer ("inherit").

Object window

Window or frame object that contains the layer.

Object x

Horizontal position (in pixels) of the left edge of the layer.

Object  y

Vertical position (in pixels) of the top edge of the layer.

Object zIndex

Position of the layer in the z-order, relative to its sibling layers.

Method Detail

captureEvents() : Object

Sets the layer to capture all events of a specified type.

handleEvent() : Object

Calls the event handler for the specified event.

load(String src, Number width) : Object

Loads contents into the layer and updates the width of the layer.

StringsrcURL for the contents of the layer.
NumberwidthNew width of the layer.

See Also

Layer.src

Availability

Netscape 4 only

moveAbove(Object target) : Object

Moves the current layer above another layer.

ObjecttargetLayer to move the current layer above.

moveBelow(Object target) : Object

Moves the current layer below another layer.

ObjecttargetLayer to move the current layer below.

moveBy(Number dx, Number dy) : Object

Moves the layer the specified amount down and to the right.

NumberdxAmount to move the layer to the right. Specify a negative value to move the layer to the left.
NumberdyAmount to move the layer down. Specify a negative value to move the layer up.

moveTo(Object x, Object y) : Object

Moves the layer to a specified position relative to the document or parent layer.

ObjectxHorizontal position (in pixels) of the left edge of the layer.
ObjectyVertical position (in pixels) of the top edge of the layer.

moveToAbsolute(Object x, Object y) : Object

Moves the layer to a specified position on the page.

ObjectxHorizontal position (in pixels) of the left edge of the layer.
ObjectyVertical position (in pixels) of the top edge of the layer.

Availability

Netscape 4 only

offset(Number dx, Number dy) : Object

Moves a layer down and to the right by a specified amount. Deprecated by moveBy().

NumberdxAmount to move the layer to the right. Specify a negative value to move the layer to the left.
NumberdyAmount to move the layer down. Specify a negative value to move the layer up.

See Also

moveBy

Availability

Netscape 4 only | deprecated

releaseEvents() : Object

Sets the layer to release all captured events of a specified type.

resizeBy(Number dw, Number dh) : Object

Resize the layer by the specified amount.

NumberdwNumber of pixels to resize the layer by horizontally.
NumberdhNumber of pixels to resize the layer by vertically.

Availability

Netscape 4 only

resizeTo(Object width, Object height) : Object

Resize the layer to a specified size.

ObjectwidthNumber of pixels wide the layer should be.
ObjectheightNumber of pixels tall the layer should be.

routeEvent() : Object

Routes a captured event through the event hierarchy.