Event Again - [技术 | Tech]
First , let’s focus on DOM Level 2 Event model which uses addEventListener(type , handle, capture ) .
Instead of dispatch event directly to the target , event has a propagation in the following 3 phases :
capturing phase : from Document element to the target
target phase :
bubble phase : from target to Document
the 3rd argument of addEventListener capture : if true , the event type of the element has a capturing phase ; if false , has no capturing phase .
event.stopPropagation() is the way to stop bubble phase .
Second , let’s focus on IE Event Model
between DOM Level 0 Event Model and DOM Level 2 Event Model .
has no capturing phase .
event is property of window .
bubbling phase can be stoped by cancelBubble = true.
Third , IE’s setCapture releaseCapture .