Skip to content

Instantly share code, notes, and snippets.

@starzonmyarmz
Created August 19, 2011 17:36
Show Gist options
  • Save starzonmyarmz/1157432 to your computer and use it in GitHub Desktop.
Save starzonmyarmz/1157432 to your computer and use it in GitHub Desktop.
Test for iOS devices
/* 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