Created
January 16, 2017 14:32
-
-
Save RitaDias/715553e731e4e22796d2d553c6c83251 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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