Skip to content

Instantly share code, notes, and snippets.

@RitaDias
Created January 16, 2017 14:32
Show Gist options
  • Save RitaDias/715553e731e4e22796d2d553c6c83251 to your computer and use it in GitHub Desktop.
Save RitaDias/715553e731e4e22796d2d553c6c83251 to your computer and use it in GitHub Desktop.
function touchMove(evt, currentX, currentY, translateX, translateY) {
if (!dragDirection) {
if (Math.abs(translateX) >= Math.abs(translateY)) {
dragDirection = "horizontal";
} else {
dragDirection = "vertical";
}
requestAnimationFrame(updateUi);
// this is what actually does the animation (ノ◕ヮ◕)ノ*:・゚✧
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment