Skip to content

Instantly share code, notes, and snippets.

@thealscott
Created February 12, 2016 16:36
Show Gist options
  • Save thealscott/c51011a4e4855d7fe1eb to your computer and use it in GitHub Desktop.
Save thealscott/c51011a4e4855d7fe1eb to your computer and use it in GitHub Desktop.
more reliable touch detection
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