initDragEvent method
Initializes a new drag event.
createEvent()/initEvent() constructor pattern for synthetic events is deprecated. See the Synthetic Events page for more information.![]() ![]() |
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.
-
This is an ondrag event.
-
This is an ondragend event.
-
This is an ondragenter event.
-
This is an ondragleave event.
-
This is an ondragover event.
-
This is an ondragstart event.
-
This is an ondrop event.
- canBubble [in]
-
Type: Boolean
- cancelable [in]
-
Type: Boolean
- 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.
- altKeyArg [in]
-
Type: Boolean
The value that is returned in the altKey attribute of the event.
- shiftKeyArg [in]
-
Type: Boolean
The value that is returned in the shiftKey attribute of the event.
- metaKeyArg [in]
-
Type: Boolean
The value that is returned in the metaKey attribute of the event.
- 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.
- 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 code | Description |
|---|---|
|
The operation completed successfully. |
|
One or more arguments are invalid. |
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 7.9.2
See also

