JS判断手机是否为横竖屏
window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function() {
if (window.orientation === 180 || window.orientation === 0) {
// alert('竖屏状态!');
}
if (window.orientation === 90 || window.orientation === -90
原创
2020-05-14 10:51:45 ·
241 阅读 ·
0 评论