Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




Previous Table of Contents Next

Note that like many other layer-related features, the ability to use inline Javascript code to define the values of <LAYER> attributes is not implemented in the Beta 1 release of Netscape Navigator 4.0 (as a component of Communicator).

WIDTH

WIDTH=num

The WIDTH attribute determines how the HTML contents of the <LAYER> tag are wrapped.

If elements that cannot be wrapped, such as images, extend beyond the width specified, the actual width of the contents of the layer will be larger than the specified value. This behavior is analogous to the way in which the width of a window sets the default wrapping for any HTML it contains, and elements that cannot be wrapped (because they are wider than the window’s total width) simply extend the window to the right by adding a scrollbar. Since layers do not include scrollbars, though, a layer whose right boundary exceeds the right boundary of the window or the containing layer causes the containing element to stretch to the right.

The WIDTH attribute is optional; by default, the layer contents wrap at the right boundary of the enclosing block.

Example 32-1 shows how to use this attribute.

<HTML>
<HEAD>
<TITLE>Using the WIDTH attribute</TITLE>
</HEAD>
<BODY>
<LAYER TOP=0 LEFT=0 WIDTH=150>
<P>
The width of this layer is 150.
The width of this layer is 150.
The width of this layer is 150.
The width of this layer is 150.
</P>
</LAYER>
<LAYER TOP=150 LEFT=0 WIDTH=300>
<P>
The width of this layer is 300.
The width of this layer is 300.
The width of this layer is 300.
The width of this layer is 300.
</P>
</LAYER>
<LAYER TOP=300 LEFT=0 WIDTH=450>
<P>
The width of this layer is 450.
The width of this layer is 450.
The width of this layer is 450.
The width of this layer is 450.
</P>
</LAYER>
</BODY>
</HTML>

Example 32-1 (ex32-1.htm). The WIDTH attribute sets the layer’s horizontal span.

In this case a picture is worth a thousand words, so take a look at Figure 32-1.


Figure 32-1.  A layer’s width affects the vertical span of its HTML content.

CLIP

CLIP=leftVal,topVal,rightVal,bottomVal

The CLIP arguments determine the clipping rectangle of the layer; that is, they define the boundaries of the visible area of the layer. These values do not affect the dimensions of a layer, just the size of the layer’s visible area. Since these four values are considered a single value (an HTML attribute can only accept one value), delimiting spaces are not permitted.

The value is a set of four numbers indicating, in order, the left value, the top value, the right value, and the bottom value. The left and right values are specified as pixels from the left, while the top and bottom values are specified as pixels down from the origin of the layer (see the listings for the LEFT and TOP attributes).

You can also specify the value as a set of two integers, in which case the left and top values default to 0.

Note that the CLIP attribute is optional. If it is omitted, the clipping rectangle of a layer is the same size as the HTML content of the layer. By default, a layer expands to contain all of its content.

Z-INDEX, ABOVE, and BELOW

Z-INDEX=num

ABOVE=layerName

BELOW=layerName

num is any integer, and layerName is the name of an existing layer.

These three attributes specify the z-order (stacking order) of layers. If you set one of these attributes, it overrides the default behavior of placing new layers on top of all existing ones. Since all three of these attributes specify the z-order, only one can be used for a given layer (in order to avoid conflicts).

The Z-INDEX attribute allows a layer’s z-order to be specified in terms of an integer. Layers with high-numbered Z-INDEX values are stacked above those with lower ones. The actual value assigned to this attribute does not directly influence the layout of the page but rather the relations between layers’ Z-INDEX. The index of the topmost layer could be 100, for example, while the index of the lowest layer is 75, even if those are the only layers defined in the document. Positive Z-INDEX values cause the layer to be stacked above its parent, while negative values cause the layer to be stacked below its parent.

The ABOVE attribute specifies the layer immediately above the layer whose <LAYER> tag contains the ABOVE=layerName attribute. That is, the new layer is created just below the layer specified by the ABOVE attribute.

The BELOW attribute specifies the layer immediately beneath the layer whose <LAYER> tag contains the BELOW=layerName attribute. That is, the new layer is created just above the layer specified by the BELOW attribute. Note that the layer specified by either the ABOVE or the BELOW tag must exist when the browser evaluates the corresponding <LAYER> tag (the one containing the attribute).

For simple layer constructions, you should avoid using these attributes. It is much easier to understand the code if you define the layers in the HTML document according to the desired stacking order. If you prefer to use these attributes, we suggest that you provide comments in the code.

Currently, all nested layers exist above their parent layer in the stacking order. The Z-INDEX, ABOVE, and BELOW values are relative to sibling layers; that is, other layers that have the same parent layer. This rule is very easy to remember, because it states that a high-level layer in the hierarchy exists beneath a low-level layer. Picture a hierarchy road map (or a family tree) to see how obvious this is.

VISIBILITY

VISIBILITY=SHOW|HIDE|INHERIT

The VISIBILITY attribute determines whether the layer is visible or not. A value of HIDE hides the layer, SHOW shows the layer, and INHERIT causes the layer to have the same visibility as its parent layer. This attribute is optional, as it defaults to INHERIT.

Remember that even if the visibility of a layer is set to SHOW, you will only be able to see the layer if there are no other visible, solid layers stacked on top of it.

BGCOLOR and BACKGROUND

BGCOLOR=color
BACKGROUND=color

Previous Table of Contents Next


With any suggestions or questions please feel free to contact us