Skip to content

Instantly share code, notes, and snippets.

@danwarfel
Last active August 6, 2016 13:28
Show Gist options
  • Save danwarfel/5aa423d0e7cefa8c3f7e to your computer and use it in GitHub Desktop.
Save danwarfel/5aa423d0e7cefa8c3f7e to your computer and use it in GitHub Desktop.
Detect a Touch Screen Device Using JavaScript, From http://codesr.thewebflash.com/2014/09/detect-touch-screen-device-using.html
// # Detect a Touch Screen Device Using JavaScript #
// From http://codesr.thewebflash.com/2014/09/detect-touch-screen-device-using.html
var isTouchDevice = ('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