- From a script in the Head section, the statement that changes the layer’s bgColor property is. - Each layer’s document must define its own <FORM>. - layer.siblingAbove and layer.siblingBelow values are null. - layer.above and layer.below . - <B>This is just a yellow layer.</B>. - <B>This is just a green layer.</B>. - Related Items: layer.parentLayer property. - layer.moveAbove() method;. - layer.moveBelow() method.. - tag, but you can assign a new image whenever you like via the layer.background property.. - The value of the layer.background property is an image object (see Chapter 18). - You can remove the background image by setting the layer.background.src property to null . - Related Items: layer.bgColor property. - A layer’s background color fills the entire rectangle with the color set either in the <LAYER>. - Figure 19-1: Drag the mouse across the palette to change the layer’s background color.. - Related Items: layer.background property. - layer.onMouseOver= event handler.. - Setting a clip property does not move the layer or the content of the layer — only the visible area of the layer. - For example, a change to the layer.clip.left value also affects the layer.clip.width property value.. - Figure 19-2: Experiment with layer.clip properties. - Listing 19-4: Adjusting layer.clip properties. - Enter new clipping values to adjust the visible area of the layer.<P>. - <TD ALIGN="right">layer.clip.left:</TD>. - <TD ALIGN="right">layer.clip.top:</TD>. - <TD ALIGN="right">layer.clip.right:</TD>. - <TD ALIGN="right">layer.clip.bottom:</TD>. - <TD ALIGN="right">layer.clip.width:</TD>. - <TD ALIGN="right">layer.clip.height:</TD>. - Related Items: layer.pageX property. - layer.pageY property;. - layer.resizeTo() method.. - The layer.left and layer.top properties correspond to the LEFT and TOP attributes of the <LAYER>. - layer’s most immediate container is the one that these properties reflect.. - To let you experiment with manually setting layer.top and layer.left properties, I present a modified version of the layer.clip example ( Listing 19-4) in Listing 19-5. - Two fields are for the layer.left and. - layer.top properties. - the other two are for the layer.clip.left and. - layer.clip.top properties. - Enter new layer and clipping values to adjust the layer.<P>. - <TD ALIGN="right">layer.left:</TD>. - <TD ALIGN="right">layer.top:</TD>. - Related Items: layer.clip properties. - layer.parentLayer property.. - The layer.name property reflects the NAME attribute of the <LAYER>. - These values are retrievable and modifiable as the layer.pageX and layer.pageY properties. - Two sets of fields display (and let you change) the layer.pageX , layer.pageY , layer.left , and layer.top properties for each of the nested layers. - The layer.pageX value for the inner layer after the move is 225 pixels.. - BGCOLOR="coral">layer.pageX:</TD>. - BGCOLOR="coral">layer.pageY:</TD>. - BGCOLOR="coral">layer.left:</TD>. - BGCOLOR="coral">layer.top:</TD>. - BGCOLOR="aquamarine">layer.pageX:</TD>. - BGCOLOR="aquamarine">layer.pageY:</TD>. - BGCOLOR="aquamarine">layer.left:</TD>. - BGCOLOR="aquamarine">layer.top:</TD>. - For this kind of layer, the layer.parentLayer property object is a window object. - Be aware of the important distinction between layer.parentLayer and layer.below . - The layer.parentLayer property is used primarily to assemble references to other nested layers. - Related Items: layer.above property. - layer.below property.. - (See layer.above and layer.below properties earlier in this chapter.). - It is this attribute that is reflected by the layer.src property.. - Simply assign a new URL to the layer.src property. - Netscape also provides the layer.load() method to put new content into a layer. - Control buttons on the page let you set the layer.src property of each layer independently. - inner.document.write("<HTML><BODY><P><B>Placeholder text for raw inner layer.</B></P></BODY></HTML>"). - <B>Setting the <TT>layer.src</TT>. - <P><B>Placeholder text for raw inner layer.</B></P>. - This method, however, sets the clipping rectangle of the layer, not the layer’s size.. - Related Items: layer.load() method. - Use the page in Listing 19-8 to see how the layer.visibility property settings affect a pair of nested layers. - <B>Setting the <TT>layer.visibility</TT>. - Close relationships exist among the layer.above , layer.below , and layer.zIndex properties. - The layer.above and layer.below properties are set as described in their discussion earlier in this chapter. - layer.zIndex properties for all layers are zero.. - layer.zIndex value, the layer.above and layer.below properties for all affected layers change as a result.. - Listing 19-9 offers a way to see the results of changing the layer.zIndex properties of three overlapping sibling layers. - But, as the page reveals, the layer.above and. - layer.below properties are automatically established. - To experiment with this page, first make sure you understand the layer.above and layer.below readings for the default order of the layers. - <B>Setting the <TT>layer.zIndex</TT>. - layer.below property. - layer.moveAbove() method. - One way to change the content of a layer after it has loaded is to use the layer.load() method. - layer.load() is the layer.clip.left value). - Related Items: layer.src property.. - You can see the layer.moveAbove() method at work in Listing 19-1, earlier in this chapter.. - layer.zIndex property.. - A demonstration of the layer.moveTo() method is shown in Listing 19-11. - At the same time, the script records how far away from the layer’s top-left corner the mouseDown event occurred. - This offset information is needed so that any setting of the layer’s location takes this offset into account (otherwise the top-left corner of the layer would jump to the cursor position and be dragged from there).. - Related Items: layer.resizeBy() method. - layer.resizeTo() method;. - Related Items: layer.moveBy() method. - layer.moveTo() method;. - The layer’s events fire after the text field’s events.. - Each time you load a document into the layer — either via the SRC attribute in the. - tag or by invoking the layer.load() method, the onLoad= event handler runs. - If the document body has an onLoad= event handler, then the layer’s onLoad= event handler does not fire. - Typically, a layer’s onMouseOver=
Xem thử không khả dụng, vui lòng xem tại trang nguồn hoặc xem
Tóm tắt