July 14, 2000 - The setCapture() Method
July 14, 2000|
The setCapture() Method
Tips: July 2000
Yehuda Shiran, Ph.D.
onmousemoveevent for a
DIVelement, the appropriate event handler kicks in only when the mouse moves inside the
Sometimes, though, you want an object to capture events that occur within other objects. You can do it with the
where flag is an optional parameter equal to either
false (no capturing), or
The following box is designed to capture
onmousemove events from the whole document. You can turn this capturing off and on by a mouse click. Play around with the mouse and make sure the
setCapture() method is working according to the specifications.
Supported mouse events include
srcElement property of the window's
event object always returns the object that is positioned under the mouse rather than the object that has mouse capture. The following key events are unaffected by mouse capture, and fire as usual: