window.addEventListener('orientationchange', function(event){
if( window.orientation == 90 || window.orientation == -90 ) {
//横屏翻转处理事件
}else{
//竖屏处理事件
}
});
window.addEventListener('orientationchange', function(event){
if( window.orientation == 90 || window.orientation == -90 ) {
//横屏翻转处理事件
}else{
//竖屏处理事件
}
});
转载于:https://www.cnblogs.com/yanliangnh/p/5922675.html