All positioned objects can be stacked (see "Stacking Objects" in Chapter 7), and you can use JavaScript to find the object's order in the z-index as well as to change that order. In this example (Figures 16.9 and 16.10), clicking any of the objects will bring it to the front of the stack. Clicking another object will cause the last clicked to revert to its original position, and the new element to come to the front. Figure 16.9. This is the stacking order when the page is first loaded.
Figure 16.10. The hapless servants to the queen now pop to the front.
To set the 3D position of an object:
Tip
|