initDragEvent method

Initializes a new drag event.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 7.9.2Internet Explorer 9

Syntax

var retval = DragEvent.initDragEvent(eventType, canBubble, cancelable, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg, dataTransferArg);

Parameters

eventType [in]

Type: String

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

drag

This is an ondrag event.

dragend

This is an ondragend event.

dragenter

This is an ondragenter event.

dragleave

This is an ondragleave event.

dragover

This is an ondragover event.

dragstart

This is an ondragstart event.

drop

This is an ondrop 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.

viewArg [in]

Type: IHTMLWindow2

The current window object or null. This value is returned in the view attribute of the event.
detailArg [in]

Type: Integer

Integer that specifies additional information. This value is returned in the detail attribute of the event.

screenXArg [in]

Type: Integer

Integer that specifies the x-coordinate of the mouse pointer relative to the upper-left corner of the screen. This value is returned in the screenX attribute of the event.

screenYArg [in]

Type: Integer

Integer that specifies the y-coordinate of the mouse pointer relative to the upper-left corner of the screen. This value is returned in the screenY attribute of the event.

clientXArg [in]

Type: Integer

Integer that specifies 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 attribute of the event.

clientYArg [in]

Type: Integer

Integer that specifies 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 attribute of the event.

ctrlKeyArg [in]

Type: Boolean

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

true (true)

The left or right CONTROL key was pressed.

false (false)

Neither CONTROL key was pressed.

altKeyArg [in]

Type: Boolean

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

true (true)

The left or right ALT key was pressed.

false (false)

Neither ALT key was pressed.

shiftKeyArg [in]

Type: Boolean

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

true (true)

The left or right SHIFT key was pressed.

false (false)

Neither SHIFT key was pressed.

metaKeyArg [in]

Type: Boolean

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

true (true)

The left or right META/COMMAND key was pressed.

false (false)

Neither META/COMMAND key was pressed.

buttonArg [in]

Type: USHORT

Integer that specifies the mouse button that caused the event. This value is returned in the button attribute of the event.

0

No button is pressed.

1

The left button is pressed.

2

The right button is pressed.

relatedTargetArg [in]

Type: IEventTarget

The related element of the mouse event. This value is returned in the relatedTarget attribute of the event.
dataTransferArg [in]

Type: IHTMLDataTransfer

A dataTransfer object that represents the drag-and-drop operation. This value is returned in the dataTransfer attribute of the event.

Return value

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OK

The operation completed successfully.

E_INVALIDARG

One or more arguments are invalid.

 

Standards information

See also

DragEvent
createEvent

 

 

Show:
© 2014 Microsoft. All rights reserved.