window.addEventListener('orientationchange', function(event){
if ( window.orientation == 180 || window.orientation==0 ) {
alert("竖屏");
}
if( window.orientation == 90 || window.orientation == -90 ) {
alert("横屏");
}
});
如何判断横屏还是竖屏?
最新推荐文章于 2020-11-25 15:58:02 发布