API Docs for: 1.1.0

Class Drag

Class defined in: src/gestures/drag.js:4

Move with x fingers (default 1) around on the page. Preventing the default browser behavior is a good way to improve feel and working.

 hammertime.on("drag", function(ev) {
   console.log(ev);
   ev.gesture.preventDefault();
 });
correct_for_drag_min_distance <Boolean>
src/gestures/drag.js:154

Set correct_for_drag_min_distance to true to make the starting point of the drag be calculated from where the drag was triggered, not from where the touch started. Useful to avoid a jerk-starting drag, which can make fine-adjustments through dragging difficult, and be visually unappealing.

Default: true
drag_block_horizontal <Boolean>
src/gestures/drag.js:173

prevent default browser behavior when dragging occurs be careful with it, it makes the element a blocking element when you are using the drag gesture, it is a good practice to set this true

Default: false
drag_block_vertical <Boolean>
src/gestures/drag.js:183

same as drag_block_horizontal, but for vertical movement

Default: false
drag_lock_min_distance <Number>
src/gestures/drag.js:200

drag lock only kicks in when distance > drag_lock_min_distance This way, locking occurs only when the distance has become large enough to reliably determine the direction

Default: 25
drag_lock_to_axis <Boolean>
src/gestures/drag.js:191

drag_lock_to_axis keeps the drag gesture on the axis that it started on, It disallows vertical directions if the initial direction was horizontal, and vice versa.

Default: false
drag_max_touches <Number>
src/gestures/drag.js:165

set 0 for unlimited, but this can conflict with transform

Default: 1
drag_min_distance <Number>
src/gestures/drag.js:146

minimal movement that have to be made before the drag event gets triggered

Default: 10
drag
src/gestures/drag.js:17 Extra event object properties:
dragdown
src/gestures/drag.js:41 Extra event object properties:
dragend
src/gestures/drag.js:25 Extra event object properties:
dragright
src/gestures/drag.js:33 Extra event object properties:
dragstart
src/gestures/drag.js:21 Extra event object properties:
dragup
src/gestures/drag.js:37 Extra event object properties:
drapleft
src/gestures/drag.js:29 Extra event object properties: