Created
June 12, 2012 21:48
-
-
Save pitch-gist/2920336 to your computer and use it in GitHub Desktop.
JavaScript: Add iOS Class
This file contains hidden or 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
// find out if the device is an ios device and add a class. | |
var deviceAgent = navigator.userAgent.toLowerCase(); | |
var agentID = deviceAgent.match(/(iphone|ipod|ipad)/); | |
if (agentID) { | |
$('html').addClass('ios'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment