Skip to content

Instantly share code, notes, and snippets.

@raynimmo
Created October 11, 2014 16:48
detect iOS and do something
(function($) {
//check for iOS
var is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);
var is_safari_or_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent);
if(is_uiwebview || is_safari_or_uiwebview) {
console.log("iphone/ipad/ipod detected");
//do something such as..
$("#footer").hide();
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment