// 监听屏幕 window.addEventListener('orientationchange', function() { let orientation = window.orientation; console.log("orientation", orientation); switch(orientation) { case 90: console.log("横屏") break; default: console.log("竖屏"); } })
标签:console,log,JS,横屏,竖屏,监听,orientation From: https://www.cnblogs.com/sanyekui/p/16929491.html