Skip to content

Instantly share code, notes, and snippets.

@FelisPhasma
Last active August 29, 2015 14:05
Show Gist options
  • Save FelisPhasma/2dba8e9a970f8f6b6763 to your computer and use it in GitHub Desktop.
Save FelisPhasma/2dba8e9a970f8f6b6763 to your computer and use it in GitHub Desktop.
Detect if the user is on a mobile device.
window.isMobile = /iphone|ipod|ipad|android|blackberry|opera mini|opera mobi|skyfire|maemo|windows phone|palm|iemobile|symbian|symbianos|fennec/i.test(navigator.userAgent.toLowerCase());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment