Created
November 20, 2013 21:06
-
-
Save salcode/7571022 to your computer and use it in GitHub Desktop.
Touch Device Detection
This file contains hidden or 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
// requires Modernizr be loaded http://modernizr.com/download/ | |
// with Misc. => Touch Events support | |
function isTouchDevice() { | |
return ( | |
// detects touch events (not present on Windows Mobile) | |
Modernizr.touch | |
|| | |
// detects Windows Mobile touch support | |
navigator.msMaxTouchPoints | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment