Created
August 3, 2016 11:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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