Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Created October 11, 2010 00:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Takazudo/619734 to your computer and use it in GitHub Desktop.
Save Takazudo/619734 to your computer and use it in GitHub Desktop.
quick orientation detection
/* quick orientation detection */
document.body.onorientationchange = (function(){
document.body.className =
orientation % 180 == 0 ? 'vertical' : 'horizontal';
return arguments.callee;
})();
/* from http://mir.aculo.us/2010/10/08/quick-and-easy-orientation-detection-for-mobile-sites/ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment