Created
March 11, 2016 11:39
-
-
Save lakinmohapatra/669f001b101b603bd6ad to your computer and use it in GitHub Desktop.
Check for touchscreen devices using javascript
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 is_touch_device() { | |
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