Skip to content

Instantly share code, notes, and snippets.

@sdeering
Created November 14, 2013 01:06
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 sdeering/7459478 to your computer and use it in GitHub Desktop.
Save sdeering/7459478 to your computer and use it in GitHub Desktop.
Capture iPad device change (IOS7) tested.
//capture ipad device change (IOS7) tested.
function doOnOrientationChange()
{
// alert(window.orientation);
switch(window.orientation)
{
case 0:
case 90:
// alert('portrait');
$('html').removeClass('landscape').addClass('portrait');
break;
case -90:
// alert('landscape');
$('html').removeClass('portrait').addClass('landscape');
break;
default:
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment