Gets the type of drag-and-drop operation currently selected or sets the operation to a new type. The value must be
Provides all of the types of operations that are possible. Must be one of
Contains a list of all the local files available on the data transfer. If the drag operation doesn't involve dragging files, this property is an empty list.
DataTransfer.items(en-US) Read only
DataTransferItemList(en-US) object which is a list of all of the drag data.
DataTransfer.types(en-US) Read only
備註： All of the properties in this section are Gecko-specific.
Gives the drag cursor's state. This is primarily used to control the cursor during tab drags.
Gives the number of items in the drag operation.
Nodeover which the mouse cursor was located when the button was pressed to initiate the drag operation. This value is
nullfor external drags or if the caller can't access the node.
This property applies only to the
dragendevent, and is
trueif the user canceled the drag operation by pressing escape. It will be
falsein all other cases, including if the drag failed for any other reason, for instance due to a drop over an invalid location.
Remove the data associated with a given type. The type argument is optional. If the type is empty or not specified, the data associated with all types is removed. If data for the specified type does not exist, or the data transfer contains no data, this method will have no effect.
Retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data.
Set the data for a given type. If data for the type does not exist, it is added at the end, such that the last item in the types list will be the new format. If data for the type already exists, the existing data is replaced in the same position.
Set the image to be used for dragging if a custom one is desired.
備註： All of the methods in this section are Gecko-specific.
Sets the drag source to the given element.
Removes the data associated with the given format for an item at the specified index. The index is in the range from zero to the number of items minus one.
Retrieves the data associated with the given format for an item at the specified index, or null if it does not exist. The index should be in the range from zero to the number of items minus one.
A data transfer may store multiple items, each at a given zero-based index.
mozSetDataAt()may only be called with an index argument less than
mozItemCountin which case an existing item is modified, or equal to
mozItemCountin which case a new item is added, and the
mozItemCountis incremented by one.
Holds a list of the format types of the data that is stored for an item at the specified index. If the index is not in the range from 0 to the number of items minus one, an empty string list is returned.
Every method and property listed in this document has its own reference page and each reference page either directly includes an example of the interface or has a link to an example.
|HTML Standard |
BCD tables only load in the browser