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);