Export (0) Print
Expand All

initWheelEvent method

Initializes a new mouse wheel event that the createEvent method created.

Document Object Model (DOM) Level 3 Events Specification, Section 5.2.4Internet Explorer 9

 

Syntax

var retval = WheelEvent.initWheelEvent(eventType, canBubble, cancelable, view, detail, screenXArg, screenYArg, clientXArg, clientYArg, buttonArg, relatedTargetArg, modifiersListArg, deltaX, deltaY, deltaZ, deltaMode);

Parameters

eventType [in]

Type: String

One of the following values, or a user-defined custom event type.

wheel

An onwheel event.

canBubble [in]

Type: Boolean

true (true)

The event should propagate upward.

false (false)

The event does not propagate upward.

cancelable [in]

Type: Boolean

true (true)

The default action can be canceled.

false (false)

The default action cannot be canceled.

view [in]

Type: IHTMLWindow2

The active window object or null. This value is returned in the view property 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.

0

No mouse button is pressed.

1

The left mouse button is pressed.

2

The right mouse button is pressed.

relatedTargetArg [in]

Type: IEventTarget

A reference to the related element. For more information, see relatedTarget.

modifiersListArg [in]

Type: String

A space-separated list of any of the following values:

Alt

The left or right Alt key is pressed.

AltGraph

The Ctrl and Alt keys are pressed.

CapsLock

The Caps Lock toggle is enabled.

Control

The left or right Ctrl key is pressed.

Meta

The Meta/Control key is pressed.

NumLock

The Num Lock toggle is enabled.

Scroll

The Scroll Lock toggle is enabled.

Shift

The left or right Shift key is pressed.

Win

The left or right Windows logo key is pressed.

deltaX [in]

Type: Integer

The distance that the mouse wheel has rotated around the x-axis. This value is returned in the deltaX property of the event.

deltaY [in]

Type: Integer

The distance that the mouse wheel has rotated around the y-axis. This value is returned in the deltaY property of the event.

deltaZ [in]

Type: Integer

The distance that the mouse wheel has rotated around the z-axis. This value is returned in the deltaZ property of the event.

deltaMode [in]

Type: unsigned long

The delta mode of the event. This value is returned in the deltaMode 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

See also

WheelEvent

 

 

Show:
© 2014 Microsoft