Created
February 1, 2012 18:17
-
-
Save KruegerDesigns/1718433 to your computer and use it in GitHub Desktop.
Add iOS class to html tag for iphone, ipod, and ipad.
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
// adds ios class to html tag | |
jQuery(document).ready(function($){ | |
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
Thanks for this it's very neat and clean!