layerNN |4| IE n/a DOM n/a  

  

The layer object reflects the layer and ilayer elements. Found in Navigator 4 only. Other elements (such as div and span) that have style sheet position attributes set to absolute or relative are arbitrarily converted to layer objects in Navigator 4.

 
HTML Equivalent
 
<ilayer>
<layer>
 
Object Model Reference
 
[window.]document.layerName
 
Object-Specific Properties
 
abovebackgroundbelowbgColorclip
hiddenleftnamepageXpageY
parentLayersiblingAbovesiblingBelowsrctop
visibilityzIndex
 
Object-Specific Methods
 
captureEvents( )handleEvent[ ]load( )moveAbove( )
moveBelow( )moveBy( )moveTo( )moveToAbsolute( )
releaseEvents( )resizeBy( )resizeTo( )routeEvent( )
 
Object-Specific Event Handler Properties
 
HandlerNNIEDOM
onblur4n/an/a
onfocus4n/an/a
onload4n/an/a
onmouseout4n/an/a
onmouseover4n/an/a
onmouseup4n/an/a
above, belowNN |4| IE n/a DOM n/a  

Read-only  

Return a reference to the positionable element whose stacking z-order is above or below the current element. These properties operate in the context of all positionable elements in a document. If the current element is the highest element, the above property returns null. To restrict the examination of next higher or lower elements within a single layer context, see siblingAbove and siblingBelow. To adjust the stacking order with respect to specific objects, see the moveAbove( ) and moveBelow( ) methods.

 
Example
 
var nextHigher = document.myILayer.above;
 
Value

Object reference or null.

 
Default

None.

backgroundNN |4| IE n/a DOM n/a  

Read/Write  

This property holds an image object that has a src property that can be set to change the image used for the layer's background. In other words, you must set the src property of the layer's background object to change the image.

 
Example
 
document.myIlayer.background.src = "images/newlogo.gif";
 
Value

An image object property, such as src.

 
Default

None.

bgColorNN |4| IE n/a DOM n/a  

Read/Write  

Provides the background color of the element. While you may set the value with either a hexadecimal triplet or plain-language color value, values returned from the property are for some reason the decimal equivalent of the hexadecimal RGB version. The default behavior is a transparent background created with a bgColor property value of null.

 
Example
 
document.myIlayer.bgColor = "yellow";
 
Value

A hexadecimal triplet or plain-language color name. See Appendix A for acceptable plain-language color names. Returned values are the decimal equivalent of the hexadecimal value. A value of null sets the background to transparent.

 
Default

null (transparent).

clipNN |4| IE n/a DOM n/a  

Read/Write  

Defines a clipping region of a positionable element. This property is treated more like an object in itself, in that you adjust its values through six properties: clip.top, clip.left, clip.bottom, clip.right, clip.width, and clip.height. Adjust the side(s) or dimension(s) of your choice. All values represent pixel values.

 
Example
 
document.myIlayer.clip.width = 150;
 
Value

Integer.

 
Default

None.

hiddenNN |4| IE n/a DOM n/a  

Read/Write  

Specifies whether the object is visible on the page. When the object is hidden, its surrounding content does not close the gap left by the element.

 
Example
 
document.myIlayer.hidden = false;
 
Value

Boolean value: true | false.

 
Default

false

leftNN |4| IE n/a DOM n/a  

Read/Write  

For positionable elements, defines the position (in pixels) of the left edge of an element's box (content plus left padding, border, and/or margin) relative to the left edge of the next outermost block content container. For the relative-positioned layer, the offset is based on the left edge of the inline location of where the element would normally appear in the content.

 
Example
 
document.myIlayer.left = 45;
 
Value

Integer.

 
Default

0

nameNN |4| IE n/a DOM n/a  

Read-only  

This is the identifier associated with a layer for use as the value assigned to target attributes or as script references to the frame. If no value is explicitly assigned to the id attribute, Navigator automatically assigns the name attribute value to the id attribute.

 
Example
 
if (document.layers[2].name == "main") {
    ...
}
 
Value

Case-sensitive identifier that follows the rules of identifier naming: it may contain no whitespace, cannot begin with a numeral, and should avoid punctuation except for the underscore character.

 
Default

None.

pageX, pageYNN |4| IE n/a DOM n/a  

Read/Write  

Provide the horizontal (x) and vertical (y) position of the object relative to the top and left edges of the entire document.

 
Example
 
document.myIlayer.pageX = 400;
 
Value

Integer.

 
Default

None.

parentLayerNN |4| IE n/a DOM n/a  

Read-only  

Returns a reference to the next outermost layer in the containment hierarchy. For a single layer in a document, its parentLayer is the window object.

 
Example
 
if (parentLayer != window) {
    ...
}
 
Value

Object reference (a layer or window).

 
Default

window

siblingAbove, siblingBelowNN |4| IE n/a DOM n/a  

Read-only  

Return a reference to the positionable element whose stacking z-order is above or below the current element, but only within the context of the shared parentLayer. If the current element is the highest element, the siblingAbove property returns null. To widen the examination of next higher or lower elements to a document-wide context, see above and below. To adjust the stacking order with respect to specific objects, see the moveAbove( ) and moveBelow( ) methods.

 
Example
 
var nextHigher = document.myILayer.siblingAbove;
 
Value

Object reference or null.

 
Default

None.

srcNN |4| IE n/a DOM n/a  

Read/Write  

Indicates the URL of the external content file loaded into the current element. To change the content, assign a new URL to the property.

Assigning a new URL to this property does not work with inline layers (ilayer elements) in Navigator 4. Instead the current source document is removed, and other page elements can be obscured. Avoid setting this property for inline layers. The same goes for the load( ) method.

 
Example
 
document.myIlayer.src = "swap2.html";
 
Value

Complete or relative URL as a string.

 
Default

None.

topNN |4| IE n/a DOM n/a  

Read/Write  

For positionable elements, defines the position of the top edge of an element's box (content plus top padding, border, and/or margin) relative to the top edge of the next outermost block content container. All measures are in pixels. When the element is a relative-positioned inline layer, the offset is based on the top edge of the inline location of where the element would normally appear in the content.

 
Example
 
document.myIlayer.top = 50;
 
Value

Integer.

 
Default

0

visibilityNN |4| IE n/a DOM n/a  

Read/Write  

Indicates the state of the positioned element's visibility. Surrounding content does not close the space left by an element whose visibility property is set to hide (or the CSS version, hidden). If you set the property to the CSS syntax values (hidden | visible), they are converted internally to the JavaScript versions and returned from the property in that format.

 
Example
 
document.myIlayer.visibility = "hide";
 
Value

One of the constant values (as a string): hide | inherit | show.

 
Default

inherit

zIndexNN |4| IE n/a DOM n/a  

Read/Write  

For a positioned element, determines the stacking order relative to other elements within the same parent container. See Chapter 4 for details on relationships of element layering amid multiple containers.

 
Example
 
document.myIlayer.zIndex = 3;
 
Value

Integer.

 
Default

0

captureEvents( )NN |4| IE n/a DOM n/a  

captureEvents(eventTypeList)

  

Instructs the browser to grab events of a specific type before they reach their intended target objects. The object invoking this method must then have event handlers defined for the given event types to process the event.

 
Parameters
 
eventTypeList

A comma-separated list of case-sensitive event types as derived from the available Event object constants, such as Event.CLICK or Event.MOUSEMOVE.

 
Returned Value

None.

handleEvent[ ]NN |4| IE n/a DOM n/a  

handleEvent(event)

  

Instructs the object to accept and process the event whose specifications are passed as the parameter to the method. The object must have an event handler for the event type to process the event.

 
Parameters
 
  • A Navigator 4 event object.
 
Returned Value

None.

load( )NN |4| IE n/a DOM n/a  

load("URL", newLayerWidth)

  

This method lets you load a new document into a layer object. It does not work properly in Navigator 4 for ilayer elements. The existing document is unloaded from the layer, but the new one does not load as you'd expect. There is no satisfactory workaround except to transform the element into a layer.

 
Parameters
 
  • String value of the complete or relative URL of the document to be loaded into the layer.
  • Integer value in pixels of a resized width of the element to accommodate the new content.
 
Returned Value

Boolean value: true if the document loading was successful.

moveAbove( ), moveBelow( )NN |4| IE n/a DOM n/a  

moveAbove(layerObject) moveBelow(layerObject)

  

These methods shift the z-order of the current layer to a specific location relative to another, sibling layer. This is helpful if your script is not sure of the precise zIndex value of a layer you want to use as a reference point for the current layer's stacking order. Use moveAbove( ) to position the current layer immediately above the layer object referenced as a parameter.

 
Parameters
 
  • Reference to another layer object that shares the same parent as the current layer.
 
Returned Value

None.

moveBy( )NN |4| IE n/a DOM n/a  

moveBy(deltaX, deltaY)

  

A convenience method that shifts the location of the current element by specified pixel amounts along both axes. To shift along only one axis, set the other value to zero. Positive values for deltaX shift the element to the right; negative values to the left. Positive values for deltaY shift the element downward; negative values upward. This method comes in handy for path animation under the control of a setInterval( ) or setTimeout( ) method that moves the element in a linear path over time.

 
Parameters
 
  • Positive or negative pixel count of the change in horizontal direction of the element.
  • Positive or negative pixel count of the change in vertical direction of the element.
 
Returned Value

None.

moveTo( ), moveToAbsolute( )NN |4| IE n/a DOM n/a  

moveTo(x, y) moveToAbsolute(x, y)

  

Convenience methods that shift the location of the current element to a specific coordinate point. The differences between the two methods show when the element to be moved is nested inside another positioned container (e.g., a layer inside a layer). The moveTo( ) method uses the coordinate system of the parent container; the moveToAbsolute( ) method uses the coordinate system of the page. For a single layer on a page, the two methods yield the same result.

 
Parameters
 
  • Positive or negative pixel count relative to the top of the reference container, whether it is the next outermost layer (moveTo( )) or the page (moveToAbsolute( )).
  • Positive or negative pixel count relative to the left edge of the reference container, whether it is the next outermost layer (moveTo( )) or the page (moveToAbsolute( )).
 
Returned Value

None.

releaseEvents( )NN |4| IE n/a DOM n/a  

releaseEvents(eventTypeList)

  

The opposite of layerObj.captureEvents( ), this method turns off event capture at the layer level for one or more specific events named in the parameter list. See Chapter 6.

 
Parameters
 
eventTypeList

A comma-separated list of case-sensitive event types as derived from the available Event object constants, such as Event.CLICK or Event.MOUSEMOVE.

 
Returned Value

None.

resizeBy( )NN |4| IE n/a DOM n/a  

resizeBy(deltaX, deltaY)

  

A convenience method that shifts the width and height of the current element by specified pixel amounts. To adjust along only one axis, set the other value to zero. Positive values for deltaX make the element wider; negative values make the element narrower. Positive values for deltaY make the element taller; negative values make the element shorter. The top and left edges remain fixed; only the right and bottom edges are moved.

 
Parameters
 
  • Positive or negative pixel count of the change in horizontal dimension of the element.
  • Positive or negative pixel count of the change in vertical dimension of the element.
 
Returned Value

None.

resizeTo( )NN |4| IE n/a DOM n/a  

resizeTo(x, y)

  

Convenience method that adjusts the height and width of the current element to specific pixel sizes. The top and left edges of the element remain fixed, while the bottom and right edges move in response to this method.

 
Parameters
 
  • Width in pixels of the element.
  • Height in pixels of the element.
 
Returned Value

None.

routeEvent( )NN |4| IE n/a DOM n/a  

routeEvent(event)

  

Used inside an event handler function, this method directs Navigator to let the event pass to its intended target object.

 
Parameters
 
  • A Navigator 4 event object.
 
Returned Value

None.