Skip to content

Instantly share code, notes, and snippets.

@VolkerK
Created April 11, 2011 14:19
Show Gist options
  • Save VolkerK/913591 to your computer and use it in GitHub Desktop.
Save VolkerK/913591 to your computer and use it in GitHub Desktop.
orientationchange sandbox
<script type="text/javascript">
jQuery(window).bind("pageshow",function(e) {
printO();
});
jQuery(window).bind("orientationchange",function(e) {
printO();
});
function printO() {
var landscape = jQuery('html.landscape').size();
var portrait = jQuery('html.portrait').size();
alert('landscape=' + landscape);
alert('portrait=' + portrait);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment