1. The event stream describes the sequence of events received from the page.
2. the IE event stream is called event bubbling, that is, the event is received by the most specific element at the beginning of the event, and then spread to a more specific node step by step;
3. Another event stream proposed by the Netscape team is called event capture. The idea of event capturing is that not specific nodes receive events first, and then specific nodes should finally receive events.
4. dom2-level events stipulate that the event flow consists of three phases: Event capture stage, out-of-target stage, and event bubble stage. First, event capture provides an opportunity to intercept events, and then receives events from the actual target.
The last is the bubble stage, which can respond to events in this stage.
5. Cancel event bubbling: Cause-only want the event to occur on the target element rather than the parent element. Method: Add a method to cancel event bubbling;
6. Not all events can be bubble or captured, such as blur, focus, load, and unload.
// General functions that prevent event bubbles
Function stopbubble (e ){
// If an event object is input, it is a non-IE browser.
If (E & E. stoppropagation ){
// Therefore, it supports the W3C stoppropagation () method.
E. stoppropagation ();
} Else {
// Otherwise, we will use the IE Method to cancel event bubbling.
Window. event. cancelbubble = true;
}
}
Reference:
Http://www.cnblogs.com/zhenn/archive/2011/02/20/1959059.html
Http://www.cnblogs.com/zhenn/archive/2011/02/19/1958748.html
Http://www.liloy.info/archives/103.html