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: truedrag_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: falsedrag_block_vertical
<Boolean>
src/gestures/drag.js:183
same as drag_block_horizontal
, but for vertical movement
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: 25drag_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: falsedrag_max_touches
<Number>
src/gestures/drag.js:165
set 0 for unlimited, but this can conflict with transform
Default: 1drag_min_distance
<Number>
src/gestures/drag.js:146
minimal movement that have to be made before the drag event gets triggered
Default: 10