Skip to content

Instantly share code, notes, and snippets.

@jcsrb
Created October 7, 2014 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcsrb/2537cc03e09b995ccff9 to your computer and use it in GitHub Desktop.
Save jcsrb/2537cc03e09b995ccff9 to your computer and use it in GitHub Desktop.
(function (){
var ua = navigator.userAgent.toLowerCase();
var android = /Android/gi.test(ua);
var iOS = /(iPad|iPhone|iPod)/gi.test(ua);
if(android) { $("body").addClass("device-running-android"); }
if(iOS) { $("body").addClass("device-running-ios"); }
if(!iOS && !android) { $("body").addClass("device-not-running-ios-or-android"); }
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment