Created
February 12, 2016 16:36
-
-
Save thealscott/c51011a4e4855d7fe1eb to your computer and use it in GitHub Desktop.
more reliable touch detection
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 isTouchDevice() { | |
return (('ontouchstart' in window) | |
|| (navigator.MaxTouchPoints > 0) | |
|| (navigator.msMaxTouchPoints > 0)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment