Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

swipe plugin #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions swipe/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

function init ()
{



x$("#zone-test").swipe(
function(e, data){

Expand Down Expand Up @@ -59,7 +58,7 @@
swipeCapture: true,
longTapCapture: true,
doubleTapCapture: true,
simpleTapCapture: false
simpleTapCapture: true

}
);
Expand Down
9 changes: 5 additions & 4 deletions swipe/xui.swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ xui.extend({
doubleTapMaxDelay: 1000,
longTapCapture: false,
longTapDelay:1000,
simpleTapCapture: false
simpleTapCapture: false,
simpleTapMaxDistance: 10
};

for ( var key in defaults ){
Expand Down Expand Up @@ -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;

}

Expand Down Expand Up @@ -183,7 +184,7 @@ xui.extend({
}
}

if (options.simpleTapCapture)
if (options.simpleTapCapture && (coords.distance < options.simpleTapMaxDistance))
clickTap(e)


Expand Down