updated swipe event detection to use 30px minimum distance and 20px tolerance

This commit is contained in:
scottjehl 2010-09-22 13:20:13 -04:00
parent a460710557
commit 517e07059a

View file

@ -141,8 +141,8 @@ $.event.special.swipe = {
$this.unbind( touchMoveEvent, moveHandler );
if ( start && stop ) {
if ( stop.time - start.time < 1000 &&
Math.abs( start.coords[0] - stop.coords[0]) > 180 &&
Math.abs( start.coords[1] - stop.coords[1]) < 80 ) {
Math.abs( start.coords[0] - stop.coords[0]) > 30 &&
Math.abs( start.coords[1] - stop.coords[1]) < 20 ) {
start.origin
.trigger( "swipe" )
.trigger( start.coords[0] > stop.coords[0] ? "swipeleft" : "swiperight" );