861Chapter 31 .Positioned Objects script needs (Web site translator) to reorder
861Chapter 31 .Positioned Objects script needs to reorder the layering in response to user action. Layer objects have four properties to help you determine the layers adjacent to a particular layer. The first pair of properties, layerObject.aboveand layerObject.below, takes a global look at all layers defined on the page regardless of the fact that one layer may contain any number of nested layers separate from other batches on the screen. If a layer lies above the one in question, the property contains a reference to that other layer; if no layer exists in that direction, then the value is null. Attempts to retrieve properties of a nonexistent layer result in runtime scripting errors indicating that the object does not have properties (of course not an object must exist before it can have properties). To understand these two properties better, consider a document that contains three layers (in any nesting arrangement you like). The first layer to be defined is on the bottom of the stack. It has a layer above it, but none below it. The second layer in the middle has a layer both above and below it. And the topmost layer has a layer only below it, with no more layers above it (that is, coming toward your eye). Another pair of properties, layerObject.siblingAboveand layerObject.siblingBelow, confines itself to the group of layers inside a parent layer container. Just as in real family life, siblings are descended from (teens might say contained by ) the same parent. An only child layer has no siblings, so both the layerObject.siblingAboveand layerObject.siblingBelow values are null. For two layers from the same parent, the first one to be defined has a sibling layer above it; the other has a sibling layer below it. It is important to understand the difference between absolute layering and sibling layering to use these properties correctly. A nested layer might be the fifth layer from the bottom among all layers on the page but at the same time be the first layer among siblings within its family group. As you can see, these two sets of properties enable your script to be very specific about the relationships under examination. Positioned objects in IE4+ and NN6 have no comparable properties to the four described in this section. On the CD-ROM Example (with Listing 31-1) on the CD-ROM Related Items: layer.parentLayer property; layer.moveAbove(), layer.moveBelow() methods. background Value: Image object Read/Write NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . You can assign a background image to a layer. The BACKGROUND attribute of the
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.