Firefox 与其他 Mozilla 应用支持多种功能来处理拖拽。这会允许用户在一个元素上点击并按住鼠标按钮，拖动它到别的位置，然后松开鼠标按钮将元素放到那儿。在拖动操作过程中，被拖动元素会以半透明形式展现，并跟随鼠标指针移动。放置元素的位置可能会在不同的应用内。网站，扩展和 XUL 应用可以利用这个功能来自定义哪些元素能够被拖动，该拖动反馈同样可以用来指定元素能够被放置在什么地方。
- 允许设置拖拽效果。有三种效果可以选择：copy 用来指明拖拽的数据将从当前位置复制到释放的位置；move 用来指明被拖拽的数据将被移动；link 用来指明将在源位置与投放位置之间建立某些形式的关联或连接。在拖拽的过程中，可以修改拖拽效果来指明在某些位置允许某些效果。如果允许，你将可以把数据释放到那个位置。请查阅Drag Effects获得更多细节。
Mozilla and Firefox support a number of features not in the standard drag and drop model. These allow you to drag multiple items and drag non-string data. For more information, see Dragging and Dropping Multiple Items.
For a list of common data types used for drag and drop, see Recommended Drag Types.
A quick reference is available for the best practice for dragging the following kinds of items:
See DataTransfer for a reference to the DataTransfer object.
A number of events are used which are fired during various stages of the drag and drop operation. Note that only drag events are fired; mouse events such as
mousemove are not fired during a drag operation.
The dataTransfer property of all drag events holds data about the drag and drop operation.
Fired on an element when a drag is started. The user is requesting to drag the element the
dragstartevent is fired at. During this event, a listener would set information such the drag data and image to be associated with the drag. For information about this, see Starting a Drag Operation.
- Fired when the mouse is first moved over an element while a drag is occuring. A listener for this event should indicate whether a drop is allowed over this location. If there are no listeners, or the listeners perform no operations, then a drop is not allowed by default. This is also the event to listen to if you want to provide feedback that a drop is allowed such as displaying a highlight or insertion marker. For information about this, see Specifying Drop Targets.
- This event is fired as the mouse is moved over an element when a drag is occuring. Much of the time, the operation that occurs during a listener will be the same as the dragenter event. For information about this, see Specifying Drop Targets.
- This event is fired when the mouse leaves an element while a drag is occuring. Listeners should remove any highlighting or insertion markers used for drop feedback.
This event is fired at the source of the drag, that is, the element where
dragstartwas fired, during the drag operation.
dropevent is fired on the element where the drop was occured at the end of the drag operation. A listener would be responsible for retrieving the data being dragged and inserting it at the drop location. This event will only fire if a drop is desired. It will not fire if the user cancelled the drag operation, for example by pressing the Escape key, or if the mouse button was released while the mouse was not over a valid drop target. For information about this, see Performing a Drop.
- The source of the drag will receive a dragend event when the drag operation is complete, whether it was successful or not. See Finishing a Drag for more information.