Javascript 事件捕获(setCapture,captureEvents)
object.setCapture() 当一个object的被 setCapture 后,他的方法将会被继承到整个文档进行捕获。
当不需要把方法继承到整个文档捕获时,要用 object.releaseCapture()
Mozilla 也有类似的功能,方法稍微不同
window.captureEvents(Event.eventType)
window.releaseEvents(Event.eventType)
Event 是Mozilla特殊的一个object.
eventType 包括: Abort, Blur, Click, Change, DblClick, DragDrop, Error, Focus, KeyDown, KeyPress, KeyUp, Load, MouseDown, MouseMove, MouseOut, MouseOver, MouseUp, Move, Reset, Resize, Select, Submit, Unload.
相关联接:
For IE
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/setcapture.asp
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/releasecapture.asp
For Mozilla
http://developer.mozilla.org/en/docs/DOM:window.captureEvents
http://developer.mozilla.org/en/docs/DOM:window.releaseEvents