EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

initMouseEvent method

Initializes a new mouse event that the createEvent method created.

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

Syntax

object.initMouseEvent(eventType, canBubble, cancelable, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg)

Parameters

eventType [in]

Type: String

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

click

An onclick event. A mouse button is clicked over an element. A click is a mousedown event and mouseup event in the same location. The value of detailArg increases for each click in the same area.

dblclick

An ondblclick event. A mouse button is double-clicked over an element.

mousedown

An onmousedown event. A mouse button is pressed over an element.

mousemove

An onmousemove event. The mouse pointer moves over an element.

mouseout

An onmouseout event. The mouse pointer moves outside the boundaries of an element.

mouseover

An onmouseover event. The mouse pointer moves into the boundaries of an element.

mouseup

An onmouseup event. A mouse button is released over an element.

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.

viewArg [in]

Type: IHTMLWindow2

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

ctrlKeyArg [in]

Type: Boolean

The value that is returned in the ctrlKey property of the event.

true (true)

The left or right Ctrl key is pressed.

false (false)

Neither Ctrl key is pressed.

altKeyArg [in]

Type: Boolean

The value that is returned in the altKey property of the event.

true (true)

The left or right Alt key is pressed.

false (false)

Neither Alt key is pressed.

shiftKeyArg [in]

Type: Boolean

The value that is returned in the shiftKey property of the event.

true (true)

The left or right Shift key is pressed.

false (false)

Neither Shift key is pressed.

metaKeyArg [in]

Type: Boolean

The value that is returned in the metaKey property of the event.

true (true)

The left or right Meta/Command key is pressed.

false (false)

Neither Meta/Command key is pressed.

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.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

See also

DragEvent
MouseEvent
MouseWheelEvent
WheelEvent
initPointerEvent
initGestureEvent

 

 

표시:
© 2014 Microsoft