fix the orientation on page to landscape only in Jquery-mobile

百般思念 提交于 2019-11-28 01:37:50

We now have responsive tables in jquerymobile 1.3.1, you could use that...

http://jquerymobile.com/demos/1.3.0-beta.1/docs/tables/

As its not possible to lock the orientation in webapps unlike hybrid apps (phonegap). Some browsers just do not help us in that.

Next you could display this data in list format OR just check the mode, if portrait then give a simple message "To view table please use landscape".

Try to use the orientation property of jQuery Mobile and set it to false.

jQuery.mobile.orientationChangeEnabled = false;

This should necessarily make a fall back on the resize window event. The resize can be handeled by min-width CSS3

http://jsfiddle.net/nY5ZF/7/

You can't lock the rotation of the browser, but what you can do is use a diferent stylesheet for one orientation and another stylesheet that will hide everything in portrait mode.

<link rel="stylesheet" type="text/css" href="css/style_l.css" media="screen and (orientation: landscape)">
<link rel="stylesheet" type="text/css" href="css/style_p.css" media="screen and (orientation: portrait)">
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!