Skip to content

Instantly share code, notes, and snippets.

@RatzeR
Created August 5, 2015 09:43
Show Gist options
  • Save RatzeR/f2928c148dadbe711ebe to your computer and use it in GitHub Desktop.
Save RatzeR/f2928c148dadbe711ebe to your computer and use it in GitHub Desktop.
function iOSversion() {
if (/iP(hone|od|ad)/.test(navigator.platform)) {
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
}
}
var ver = iOSversion();
if (ver[0] >= 7 && ver[0] < 8) {
$('html').addClass('ios7');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment