Created
August 19, 2011 17:36
-
-
Save starzonmyarmz/1157432 to your computer and use it in GitHub Desktop.
Test for iOS devices
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
/* Test for iOS device, and insert class on body tag. You can't upload files | |
* on iOS devices, but you can on Android devices, so using mobile style sheets | |
* won't work for showing and hiding certain content during the sign up process. */ | |
(function isIOS() { | |
if (/iPhone|iPod|iPad/i.test(navigator.userAgent)) { | |
$('html').addClass("ios"); | |
} else { | |
$('html').addClass("no-ios"); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment