Skip to content

Instantly share code, notes, and snippets.

@hungsu
Last active December 4, 2017 23:10
Show Gist options
  • Save hungsu/5914697 to your computer and use it in GitHub Desktop.
Save hungsu/5914697 to your computer and use it in GitHub Desktop.
function is_touch_device() {
return !!('ontouchstart' in window) // works on most browsers
|| !!('onmsgesturechange' in window); // works on ie10
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment