Skip to content

Instantly share code, notes, and snippets.

@goldbraun
goldbraun / iOSclass
Last active August 29, 2015 14:09 — forked from ctcherry/iOSclass
// adds mobile class, and mobile os to html tag
jQuery(document).ready(function($){
var deviceAgent = navigator.userAgent.toLowerCase();
if (deviceAgent.match(/(iphone|ipod|ipad)/)) {
$('html').addClass('ios');
$('html').addClass('mobile');
}
if (deviceAgent.match(/android/)) {