jQuery.event.special.swipe
Event raised after a complete cycle of pointerstart
, pointermove
, and pointerend
in which the velocity (distance of movement / duration between start and end) is greater than a minimum. Useful as a shortcut for an action, though panning can be a better option for realtime, tracked, movement of a touched element.
Bubbles and can be delegated against.
Usage
$(element).on('swipe', function(e){
// handle event...
});
Data on the event
pointers
: array of Pointer objects, each withpageX
andpageY
propertiesoriginalEvent
: Native event objectduration
: duration of the gestureangle
: angle, in degrees, of the swipe from start to finishdirection
: general direction of the swipe, based on the angle. 'up', 'down', 'right', or 'left'pageX
: x position atpointerend
pageY
: y position atpointerend