Mouse Interaction
Description: The base interaction layer.
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()
.
Dependencies
Options
cancel
"input,textarea,button,select,option"
Initialize the mouse with the cancel
option specified:
$( ".selector" ).mouse({ cancel: ".title" });
Get or set the cancel
option, after initialization:
// Getter var cancel = $( ".selector" ).mouse( "option", "cancel" ); // Setter $( ".selector" ).mouse( "option", "cancel", ".title" );
delay
0
Initialize the mouse with the delay
option specified:
$( ".selector" ).mouse({ delay: 300 });
Get or set the delay
option, after initialization:
// Getter var delay = $( ".selector" ).mouse( "option", "delay" ); // Setter $( ".selector" ).mouse( "option", "delay", 300 );
distance
1
Initialize the mouse with the distance
option specified:
$( ".selector" ).mouse({ distance: 10 });
Get or set the distance
option, after initialization:
// Getter var distance = $( ".selector" ).mouse( "option", "distance" ); // Setter $( ".selector" ).mouse( "option", "distance", 10 );
Methods
_mouseCapture()Returns: Boolean
true
. - This method does not accept any arguments.
Invoke the _mouseCapture method:
$( ".selector" ).mouse( "_mouseCapture" );
_mouseDestroy()Returns: jQuery (plugin only)
_destroy()
method. - This method does not accept any arguments.
Invoke the _mouseDestroy method:
$( ".selector" ).mouse( "_mouseDestroy" );
_mouseDown()Returns: jQuery (plugin only)
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. - This method does not accept any arguments.
Invoke the _mouseDown method:
$( ".selector" ).mouse( "_mouseDown" );
_mouseDrag()Returns: jQuery (plugin only)
_mouseDrag()
method to handle each movement of an interaction. This method will receive the mouse event associated with the movement. - This method does not accept any arguments.
Invoke the _mouseDrag method:
$( ".selector" ).mouse( "_mouseDrag" );
_mouseInit()Returns: jQuery (plugin only)
_create()
method. - This method does not accept any arguments.
Invoke the _mouseInit method:
$( ".selector" ).mouse( "_mouseInit" );
_mouseMove()Returns: jQuery (plugin only)
mouseDrag()
method for the extending widget to handle. - This method does not accept any arguments.
Invoke the _mouseMove method:
$( ".selector" ).mouse( "_mouseMove" );
_mouseStart()Returns: jQuery (plugin only)
_mouseStart()
method to handle the beginning of an interaction. This method will receive the mouse event associated with the start of the interaction. - This method does not accept any arguments.
Invoke the _mouseStart method:
$( ".selector" ).mouse( "_mouseStart" );
_mouseStop()Returns: jQuery (plugin only)
_mouseStop()
method to handle the end of an interaction. This method will receive the mouse event associated with the end of the interaction. - This method does not accept any arguments.
Invoke the _mouseStop method:
$( ".selector" ).mouse( "_mouseStop" );
_mouseUp()Returns: jQuery (plugin only)
mouseStop()
method for the extending widget to handle. - This method does not accept any arguments.
Invoke the _mouseUp method:
$( ".selector" ).mouse( "_mouseUp" );