15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The NN4<br />

Layer Object<br />

(Chapter 31)<br />

Chapter 31 of the <strong>JavaScript</strong> <strong>Bible</strong> is devoted to positioned<br />

objects in all object models. Only Navigator 4 has its<br />

own set of dedicated positionable objects: the LAYER and<br />

ILAYER element objects. In the IE4+ and W3C DOMs, virtually<br />

any renderable element is positionable, although it is common<br />

practice to restrict such activity to SPAN and DIV elements.<br />

Because properties of the SPAN, DIV, and other HTML element<br />

objects are covered in detail in other chapters, Chapter 31<br />

provides the details of the NN4 layer object.<br />

<strong>Examples</strong> shown here support NN4 layer object details, but<br />

the rest of the discussion and code listings in <strong>JavaScript</strong> <strong>Bible</strong><br />

Chapter 31 go to great lengths to recreate the same behaviors<br />

in both the IE4+ and W3C (NN6) object models. This will help<br />

those scripters who developed extensively for NN4’s Dynamic<br />

HTML make the transition to NN6 and its support for Dynamic<br />

HTML (which is not much different from that in the IE4+ object<br />

model). Obviously, all examples shown below require NN4.<br />

<strong>Examples</strong> Highlights<br />

✦ Clipping of layer rectangles is not an easy concept to<br />

grasp at first (in any object model). Listing 31-2 provides<br />

a workbench to explore the various properties associated<br />

with the clipping rectangle. Listing 31-5 demonstrates<br />

the relationship between moving a layer and<br />

adjusting its clipping rectangle.<br />

✦ Listing 31-6 is an extensive demonstration of a variety of<br />

layer coordinate system properties.<br />

✦ Most layer object properties are handled in later object<br />

models through style sheet property manipulation.<br />

Listing 31-8 shows the NN4 layer way of handling a<br />

layer’s visibility, while Listing 31-9 demonstrates adjusting<br />

the stacking order of layers.<br />

15<br />

C H A P T E R<br />

✦ ✦ ✦ ✦<br />

In This Chapter<br />

Using NN4-specific<br />

syntax for positioned<br />

elements<br />

How to move, hide,<br />

and show positioned<br />

content in NN4<br />

Setting the clipping<br />

rectangle of a layer<br />

in NN4<br />

✦ ✦ ✦ ✦

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!