orientationchange 事件
window.addEventListener('orientationchange',function(){
//orientation 倾斜角度
console.log(window.orientation);
var orientation = "";
switch(window.orientation){
case 90: case -90:
//当角度发生变化 横屏状态
orientation = 'landscape';
break;
default:
//默认竖屏状态
orientation = 'portrait';
}
},false);
网友评论