Skip to content

Instantly share code, notes, and snippets.

@fvanderbiest
Created October 31, 2014 11:14
Show Gist options
  • Save fvanderbiest/d5afb39e956d16a7cfce to your computer and use it in GitHub Desktop.
Save fvanderbiest/d5afb39e956d16a7cfce to your computer and use it in GitHub Desktop.
mobile detection
var w = window, n = w.navigator,
onMobile = (('ontouchstart' in w) ||
(('maxTouchPoints' in n) && n.maxTouchPoints > 1) ||
(('msMaxTouchPoints' in n) && n.msMaxTouchPoints > 1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment