Skip to content

Instantly share code, notes, and snippets.

@carlwood
Created August 3, 2016 11:09
Show Gist options
  • Save carlwood/6c3b94c59dd2950b0a194e76fad8c0a4 to your computer and use it in GitHub Desktop.
Save carlwood/6c3b94c59dd2950b0a194e76fad8c0a4 to your computer and use it in GitHub Desktop.
Use navigator user agent to add class if user is on mobile device
if (navigator.userAgent.match(/mobile/i)) {
$('body').addClass('touch');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment