-
-
Save ctcherry/1718490 to your computer and use it in GitHub Desktop.
Revisions
-
ctcherry revised this gist
Feb 1, 2012 . 1 changed file with 22 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,24 @@ // 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/)) { $('html').addClass('android'); $('html').addClass('mobile'); } if (deviceAgent.match(/blackberry/)) { $('html').addClass('blackberry'); $('html').addClass('mobile'); } if (deviceAgent.match(/(symbianos|^sonyericsson|^nokia|^samsung|^lg)/)) { $('html').addClass('mobile'); } }); -
Adam Krueger created this gist
Feb 1, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ // adds ios class to html tag jQuery(document).ready(function($){ var deviceAgent = navigator.userAgent.toLowerCase(); var agentID = deviceAgent.match(/(iphone|ipod|ipad)/); if (agentID) { $('html').addClass('ios'); } });