• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Scripting Events > Dragging Elements

6.7. Dragging Elements

The final example in this chapter, Example 6.4, demonstrates how event capturing and event bubbling can work together to let document-level event handlers control the dragging of elements on the screen. Because Navigator does not support events for elements that are not part of the document object hierarchy, it makes perfect sense to have the document capture all pertinent events and process them. While IE 4 could have event handlers assigned to each of the elements, that would require more effort than is necessary.

All the dragging event handlers are assigned as properties in an init() function invoked by the onLoad event handler. The only platform-specific process taking place here involves setting the document.captureEvents() method to grab all mouse down and mouse move events that come in from Navigator 4.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint