Linux web host - 176Part IIIDocument Objects Referencethe time the cursor reaches
176Part IIIDocument Objects Referencethe time the cursor reaches the click location, the page has reflowed, thereby moving the linkto somewhere else on the page. For Internet Explorer users with 32-bit Windows operating systems, IE4 includes someextra features in the object model that can enhance presentations. Filtersare stylesheetadditives that offer a variety of visual effects on body text. For example, you can add a dropshadow or a glowing effect to text by simply applying filter styles to the text, or you can cre- ate the equivalent of a slide presentation by placing the content of each slide in a posi- tioned divelement. Although filters follow the CSS syntax, they are not a part of the W3Cspecification. Event bubblingJust as Netscape invented an event model for NN4, so, too, did Microsoft invent one for IE4. Unfortunately for cross-browser scripters, the two event models are quite different. Instead ofevents trickling down the hierarchy to the target element, an IE event starts at the target ele- ment and, unless instructed otherwise, bubbles up through the element containment hier- archy to eventually reach the windowobject. At any object along the way, an event handlercan perform additional processing on that event if desired. Therefore, if you want a singleevent handler to process all click events for the page, assign the event handler to the bodyorwindowobject so the events reach those objects (provided the event bubbling isn t cancelledby some other object along the containment hierarchy). IE also has an eventobject (a property of the windowobject) that contains details aboutthe event, such as the keyboard key pressed for a keyboard event and the location of amouse event. Names for these properties are entirely different from the event object prop- erties of NN4. Despite what seems like incompatible, if not completely opposite, event models in NN4 andIE4, you can make a single set of scripts handle events in both browsers (see Chapter 25 andChapter 56 on the CD-ROM for examples). In fact, the two event models are made to worktogether in the W3C DOM Level 2 specification, described later in this chapter. Event binding of scriptsIE4 introduced an additional way of binding events to objects via a