Created
October 15, 2013 09:04
-
-
Save psflannery/6988794 to your computer and use it in GitHub Desktop.
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 characters
jQuery(document).ready(function($) { | |
//capture ipad device change | |
function doOnOrientationChange() | |
{ | |
switch(window.orientation) | |
{ | |
case -90: | |
case 90: | |
alert('landscape'); //debug | |
////add class to assist with libraries like Modernizr | |
$('html').removeClass('portrait').addClass('landscape'); | |
break; | |
default: | |
alert('portrait'); //debug | |
$('html').removeClass('landscape').addClass('portrait'); | |
break; | |
} | |
} | |
//setup event listener | |
window.addEventListener('orientationchange', doOnOrientationChange); | |
//initial call | |
doOnOrientationChange(); | |
}); |
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 characters
/* styles for tablet only */ | |
@media (min-width: 768px) and (max-width: 1024px) { | |
.portrait { | |
/* styles for ipad landscape orientation */ | |
} | |
.landscape { | |
/* styles for ipad landscape orientation */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment