判断横竖屏和切换

//判断是不是横屏,0 180是竖屏

if (window.orientation === 90 || window.orientation === -90 ){        

      }

      window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function() {

        if (window.orientation === 180 || window.orientation === 0) {

            return;

        }

        if (window.orientation === 90 || window.orientation === -90 ){

          },3000);

        }

      }, false);

猜你喜欢

转载自blog.csdn.net/Angular_/article/details/78784588