Saturday, 13 October 2012

window orientationchange

jQuery(window).bind('orientationchange', function(e) {
switch ( window.orientation ) {
case 0:
alert('portrait mode');
break;
case 90:
alert('landscape mode screen turned to the left');
break;
case -90:
alert('landscape mode screen turned to the right');
break;
}
});
view raw gistfile1.js hosted with ❤ by GitHub

No comments:

Post a Comment