Skip to content

Instantly share code, notes, and snippets.

@LiamChapman
Created June 5, 2014 13:37
Show Gist options
  • Select an option

  • Save LiamChapman/20d3afc8907022e71951 to your computer and use it in GitHub Desktop.

Select an option

Save LiamChapman/20d3afc8907022e71951 to your computer and use it in GitHub Desktop.
Var to detect if device is touch enabled. Handy for conditional mobile and tablet code.
var isTouch = 'ontouchstart' in document.documentElement;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment