/Judging the phone's status: function hengshuping () { if (window.orientation==180| | window.orientation==0) { alert ("Vertical screen status! ") } if (window.orientation==90| | WINDOW.ORIENTATION==-90) { alert ("Horizontal screen state! ") } } window.addeventlistener (" Onorientationchange "in Window?" Orientationchange ":" Resize ", hengshuping, false); Mobile browser generally support window.orientation This parameter, through this parameter can determine whether the phone is in a horizontal screen or vertical screen state. the corresponding procedure is executed according to the actual demand. By adding the Listener event Onorientationchange, the execution will be done.
http://blog.csdn.net/lee_magnum/article/details/17429613
Use JavaScript to determine the horizontal screen vertical screen problem. The JavaScript code reads "Go"