Skip to content

Instantly share code, notes, and snippets.

@salcode
Created November 20, 2013 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salcode/7571022 to your computer and use it in GitHub Desktop.
Save salcode/7571022 to your computer and use it in GitHub Desktop.
Touch Device Detection
// 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