Last active
June 9, 2017 19:15
-
-
Save mattbontrager/5217861 to your computer and use it in GitHub Desktop.
Detect presence of touch events and handle accordingly (keeping for later development).
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
var hasTouch = 'ontouchstart' in document.documentElement, | |
touchStart = hasTouch ? 'touchstart': 'mousedown', | |
touchMove = hasTouch ? 'touchmove': 'mousemove', | |
touchEnd = hasTouch ? 'touchend': 'mouseup'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment