Availability: |
| ||||
JavaScript syntax: | N | myMouseEvent = new MouseEvent() | |||
Object properties: | altKey, bubbles, button, cancelable, clientX, clientY, cllientX, ctrlKey, currentTarget, detail, eventPhase, metaKey, relatedTarget, screenX, screenY, shiftKey, target, timeStamp, type, view | ||||
Object methods: | initEvent(), initMouseEvent(), initUIEvent(), preventDefault(), stopPropagation() |
The availability of the MouseEvent object handling can be determined with the Implementation.hasFeature() method call.
The available set of events is defined by HTML 4.0 and DOM level 0 with some additional events having been added. These event types are enumerated in the DOM level 2 specification and are:
click
mousedown
mouseup
mouseover
mousemove
mouseout
The contextual information is carried in the detail property which is inherited from the UIEvent object. This value is incremented for each complete mouse click cycle but is reset to zero if the mouse is moved, even if that happens between mousedown and mouseup.
This kind of event is a scenario where event bubbling is likely to be useful because the mouse may click on a pixel sized item which is a child of the object that is really receiving a higher level event.
Property | JavaScript | JScript | Nav | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
altKey | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ![]() |
bubbles | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
button | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
cancelable | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
clientX | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
clientY | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
cllientX | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
ctrlKey | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
currentTarget | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
detail | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
eventPhase | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
metaKey | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ![]() |
relatedTarget | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
screenX | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
screenY | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
shiftKey | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | ReadOnly. |
target | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
timeStamp | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
type | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
view | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
Method | JavaScript | JScript | Nav | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
initEvent() | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
initMouseEvent() | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
initUIEvent() | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
preventDefault() | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
stopPropagation() | 1.5 ![]() | ![]() | 6.0 ![]() | ![]() | ![]() | ![]() | ![]() | 2 ![]() | ![]() | ![]() | - |
Prev | Home | Next |
Mouse events | Up | MouseEvent.altKey |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |