280 Part III . Document Objects Reference Perhaps
280 Part III . Document Objects Reference Perhaps a more common reason for capturing events at the window (or similar) level is to look for special cases, such as when someone Ctrl+clicks on an element. In this case, even though the window event handler receives all click events, it performs further processing only when the event.modifiersproperty indicates the Ctrl key is also pressed and the eventObj.target property reveals the item being clicked is a link rather than a button. All other instances of the click event are routed on their way to their destinations. The event object knows where it s going, so that your routeEvent()method doesn t have to worry about that. The parameter for the routeEvent()method is the event object that is passed to the function that processes the high-level event, as shown here: function flashRed(evt) { [statements that filter specific events to flash background color red] routeEvent(evt) } The event object, evt, comes into the function while passing unmodified to the object that was clicked. In the W3C DOM event model (as implemented in NN6), a captured event continues onward to the target after event handlers higher up the containment chain finish their work. On the CD-ROM Example on the CD-ROM Related Items: window.captureEvents(), window.releaseEvents(), window.handleEvent() methods; event object (Chapter 29). scroll(horizontalCoord, verticalCoord) Returns: Nothing. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . The window.scroll() method was introduced in NN3 and has been implemented in all scriptable browsers since then. But in the meantime, the method has been replaced by the window.scrollTo() method, which is in more syntactic alliance with many other window methods. Use the window.scroll() method only if your audience is still using NN3; for an audience of NN4+ and IE4+, use the window.scrollTo() method instead. The window.scroll() method takes two parameters, the horizontal (x) and vertical (y) coordinates of the document that is to be positioned at the top-left corner of the window or frame. You must realize that the window and document have two similar, but independent, coordinate schemes. From the window s point of view, the top-left pixel (of the content area) is point 0,0. All documents also have a 0,0 point: the very top-left of the document. The window s 0,0 point doesn t move, but the windowObject.scroll()
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.