屏幕旋转事件
window.onorientationchange = function(){ switch(window.orientation){ case -90: case 90: alert("横屏:" + window.orientation); case 0: case 180: alert("竖屏:" + window.orientation); break; }}
竖屏时样式:
//竖屏时使用的样式@media all and (orientation:portrait) { .css{}}
横屏时样式:
//横屏时使用的样式@media all and (orientation:landscape) { .css{}}