Mouse Interaction
Description: The base interaction layer.
Options
cancelType: Selector
Default:
"input,textarea,button,select,option"
Prevents interactions from starting on specified elements.
delayType: Number
Default:
0
Time in milliseconds after mousedown until the interaction should start. This option can be used to prevent unwanted interactions when clicking on an element.
distanceType: Number
Default:
1
Distance in pixels after mousedown the mouse must move before the interaction should start. This option can be used to prevent unwanted interactions when clicking on an element.
Methods
_mouseCapture() Returns: Boolean
Determines whether an interaction should start based on event target of the interaction. The default implementation always returns
true
.
_mouseDestroy()
Destroys the interaction event handlers. This must be called from the extending widget's
_destroy()
method.
_mouseDown()
Handles the beginning of an interaction. Verifies that the event is associated with the primary mouse button and ensures that the
delay
and distance
options are met prior to starting the interaction. When the interaction is ready to start, invokes the _mouseStart()
method for the extending widget to handle.
_mouseDrag()
The extending widget should implement a
_mouseDrag()
method to handle each movement of an interaction. This method will receive the mouse event associated with the movement.
_mouseInit()
Initializes the interaction event handlers. This must be called from the extending widget's
_create()
method.
_mouseMove()
Handles each movement of the interaction. Invokes the
mouseDrag()
method for the extending widget to handle.
_mouseStart()
The extending widget should implement a
_mouseStart()
method to handle the beginning of an interaction. This method will receive the mouse event associated with the start of the interaction.
_mouseStop()
The extending widget should implement a
_mouseStop()
method to handle the end of an interaction. This method will receive the mouse event associated with the end of the interaction.
_mouseUp()
Handles the end of the interaction. Invokes the
mouseStop()
method for the extending widget to handle.
Similar to jQuery.Widget
, the mouse interaction is not intended to be used directly. It is purely a base layer for other widgets to inherit from. This page only documents what is added to jQuery.Widget
, but it does include internal methods that are not intended to be overwritten. The intended public API is _mouseStart()
, _mouseDrag()
, _mouseStop()
, and _mouseCapture()
.