diff --git a/swipe/index.html b/swipe/index.html index dec21e9..8b395f4 100644 --- a/swipe/index.html +++ b/swipe/index.html @@ -28,8 +28,7 @@ function init () { - - + x$("#zone-test").swipe( function(e, data){ @@ -59,7 +58,7 @@ swipeCapture: true, longTapCapture: true, doubleTapCapture: true, - simpleTapCapture: false + simpleTapCapture: true } ); diff --git a/swipe/xui.swipe.js b/swipe/xui.swipe.js index ff8f1ba..37976c7 100644 --- a/swipe/xui.swipe.js +++ b/swipe/xui.swipe.js @@ -16,7 +16,8 @@ xui.extend({ doubleTapMaxDelay: 1000, longTapCapture: false, longTapDelay:1000, - simpleTapCapture: false + simpleTapCapture: false, + simpleTapMaxDistance: 10 }; for ( var key in defaults ){ @@ -59,8 +60,8 @@ xui.extend({ startTime = (new Date).getTime(); originalCoord.x = e.targetTouches[0].clientX; originalCoord.y = e.targetTouches[0].clientY; - finalCoord.x = 0; - finalCoord.y = 0; + finalCoord.x = originalCoord.x; + finalCoord.y = originalCoord.y; } @@ -183,7 +184,7 @@ xui.extend({ } } - if (options.simpleTapCapture) + if (options.simpleTapCapture && (coords.distance < options.simpleTapMaxDistance)) clickTap(e)