Skip to content

Instantly share code, notes, and snippets.

@carlosvillu
Created December 9, 2011 13:32
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 carlosvillu/1451530 to your computer and use it in GitHub Desktop.
Save carlosvillu/1451530 to your computer and use it in GitHub Desktop.
Lazy pattern para isMobile
var isMobile = function() {
var result = false;
for (var i = 0, len = SUPPORTED_OS.length; i < len && !result; i++) {
var mobile_os = SUPPORTED_OS[i];
$.os[mobile_os] && (result = true);
}
return isMobile = result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment