爱米*阅

不是日志,不是剪切板

Event Again - [技术 | Tech]

发布时间   2011-02-17 @ 16:31:00 标签    javascript event 编辑 | 分享 0

版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://www.blogbus.com/amixyue-logs/105637609.html

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 .

分享到: