Skip to content

Instantly share code, notes, and snippets.

@yomotsu
Last active December 22, 2017 21:54
Show Gist options
  • Save yomotsu/02b515d16bf4cd232637d059d701b35a to your computer and use it in GitHub Desktop.
Save yomotsu/02b515d16bf4cd232637d059d701b35a to your computer and use it in GitHub Desktop.
const isTouchDevice = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
const isMobile = /Mobile|iPhone|iPod|iPad|Android/.test( navigator.userAgent );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment