DragEvent object

Provides event properties that are specific to drag-and-drop events.

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

 

DOM Information

Inheritance Hierarchy

 Event
  UIEvent
   MouseEvent
     DragEvent

Members

The DragEvent object has these types of members:

Methods

The DragEvent object has these methods.

MethodDescription
getModifierState

Queries the state of the specified modifier key.

initDragEvent

Initializes a new drag event.

initEvent

Initializes a new generic event that the createEvent method created.

initMouseEvent

Initializes a new mouse event that the createEvent method created.

initUIEvent

Initializes a new user interface event that the createEvent method created.

msConvertURL

Instructs the HTML paste operation on how to modify the src attribute that correspond to each file in the clipboardData.files collection.

preventDefault

Cancels the default action of an event.

stopImmediatePropagation

Prevents any further propagation of an event.

stopPropagation

Prevents propagation of an event beyond the current target.

 

Properties

The DragEvent object has these properties.

PropertyDescription

altKey

Gets a value that indicates whether the Alt key is pressed.

bubbles

Gets a value that indicates whether an event propagates up from the event target.

button

Indicates which pointer device button has changed.

buttons

Indicates which pointer device buttons are being pressed, expressed as a bitmask.

cancelable

Gets a value that indicates whether you can cancel an event's default action.

cancelBubble

Gets or sets a value that indicates whether an event should be stopped from propagating up from the current target.

clientX

Gets the x-coordinate of the mouse pointer, relative to the upper-left corner of the viewport (that is, the application's client area).

clientY

Gets the y-coordinate of the mouse pointer, relative to the upper-left corner of the viewport (that is, the application's client area).

ctrlKey

Gets a value that indicates whether the Ctrl key is pressed.

currentTarget

Gets the event target that is currently being processed.

dataTransfer

Retrieves the dataTransfer object associated with the event.

defaultPrevented

Gets a value that indicates whether the default action should be canceled.

detail

Gets additional information about an event.

eventPhase

Gets the event phase that is being evaluated.

fromElement

Gets the object that the mouse pointer exited.

isTrusted

Gets a value that indicates whether a trusted event source created an event.

layerX

Gets the x-coordinate of the mouse pointer, relative to the last positioned ancestor element.

layerY

Gets the y-coordinate of the mouse pointer, relative to the last positioned ancestor element.

metaKey

Gets a value that indicates whether the Meta/Control key is pressed.

offsetX

Gets the x-coordinate of the mouse pointer, relative to the target node.

offsetY

Gets the y-coordinate of the mouse pointer, relative to the target node.

pageX

Gets the x-coordinate of the mouse pointer, relative to the upper-left corner of the page.

pageY

Gets the y-coordinate of the mouse pointer, relative to the upper-left corner of the page.

relatedTarget

Gets the secondary element that is involved in an event.

screenX

Gets the x-coordinate of the mouse pointer, relative to the upper-left corner of the screen.

screenY

Gets the y-coordinate of the mouse pointer, relative to the upper-left corner of the screen.

shiftKey

Gets a value that indicates whether the Shift key is pressed.

srcElement

Gets the element that the event was originally dispatched to. Compare to target.

target

Gets the element that is the target of the event.

timeStamp

Gets the time, in milliseconds, when an event occurred.

toElement

Gets the object that the mouse pointer entered.

type

Gets the name of an event.

view

Gets the window object that an event is generated from.

which

Gets which mouse button is pressed.

x

Gets the x-coordinate of the mouse pointer, relative to the last positioned ancestor element.

y

Gets the y-coordinate of the mouse pointer, relative to the last positioned ancestor element.

 

Standards information

See also

Reference
initDragEvent
ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart

 

 

Show:
© 2014 Microsoft