You can use window.onorientationchange function
for this
like,
function testLandscape()
{
if($(window).height()<$(window).width())
{
alert('landscape mode');
return false;
}
}
window.onorientationchange=function(){
testLandscape();//test on changing orientation
}
testLandscape();//test on page loads
1
solved How to fix landscape mode HTML5 web app in Mobile [closed]