How can we detect orientation changes on the mobile devices such smart phones, tablets? The jQuery Mobile orientationchange
event is fired when the user rotates the mobile device vertically or horizontally.
$(window).on( "orientationchange", function( event ) {
alert("This device is in " + event.orientation + " mode!" )
});