标签:
window.orientation可以获取屏幕的方向
var orientationTimmer = null;
window.addEventListener(window[‘onorientationchange‘] ? ‘orientationchange‘ : ‘resize‘, function(){
clearTimeout(orientationTimmer);
orientationTimmer = setTimeout(function(){
if(window.orientation){
switch(window.orientation){
case 90:
alert(‘左旋‘)
break;
case -90:
alert(‘右旋‘)
break;
}
}
},200);
}, false);
标签:
原文地址:http://www.cnblogs.com/dtdxrk/p/4642491.html