initMouseWheelEvent method
Initializes a new mouse wheel event that the createEvent method created. For the standards based method, see initWheelEvent.
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() |
Syntax
var retval = MouseWheelEvent.initMouseWheelEvent(eventType, canBubble, cancelable, view, detail, screenXArg, screenYArg, clientXArg, clientYArg, buttonArg, relatedTargetArg, modifiersListArg, wheelDeltaArg);Parameters
- eventType [in]
-
Type: String
The following value, or a user-defined custom event type.
-
An onmousewheel event. The mouse wheel rotates upward or downward.
- canBubble [in]
-
Type: Boolean
- cancelable [in]
-
Type: Boolean
- view [in]
-
Type: IHTMLWindow2
The active window object or null. This value is returned in the view attribute of the event. - detail [in]
-
Type: Integer
A number that can provide additional information about the event. This value is returned in the detail property of the event.
- screenXArg [in]
-
Type: Integer
The x-coordinate of the mouse pointer, relative to the upper-left corner of the screen. This value is returned in the screenX property of the event.
- screenYArg [in]
-
Type: Integer
The y-coordinate of the mouse pointer, relative to the upper-left corner of the screen. This value is returned in the screenY property of the event.
- clientXArg [in]
-
Type: Integer
The x-coordinate of the mouse pointer, relative to the upper-left corner of the browser's client area. This value is returned in the clientX property of the event.
- clientYArg [in]
-
Type: Integer
The y-coordinate of the mouse pointer, relative to the upper-left corner of the browser's client area. This value is returned in the clientY property of the event.
- buttonArg [in]
-
Type: Number
The mouse button that caused the event. This value is returned in the button property of the event.
- relatedTargetArg [in]
-
Type: IEventTarget
A reference to the related element. For more information about how related elements are used with mouse events, see relatedTarget.
- modifiersListArg [in]
-
Type: String
A space-separated list of any of the following values:
-
The left or right Alt key is pressed.
-
The Ctrl and Alt keys are pressed.
-
The Caps Lock toggle is enabled.
-
The left or right Ctrl key is pressed.
-
The Meta/Control key is pressed.
-
The Num Lock toggle is enabled.
-
The Scroll Lock toggle is enabled.
-
The left or right Shift key is pressed.
-
The left or right Windows logo key is pressed.
- wheelDeltaArg [in]
-
Type: Integer
The distance that the wheel has rotated around the y-axis (vertically). This value is returned in the wheelDelta property of the event.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
There are no standards that apply here.
Remarks
A MouseWheelEvent event can capture wheel movement along a vertical axis only. To capture movement in all directions, use WheelEvent instead.
See also
