横屏竖屏监控

//横屏竖屏监控
var evt = "onorientationchange" in window ? "orientationchange" : "resize";
window.addEventListener(evt, resize, false);
function resize(fals) {
if (window.orientation == 0 || window.orientation == 180) {
documment.getElementsByClassName('swiper-container')[0].style.width = '100%'
}
}

你可能感兴趣的:(横屏竖屏监控)