bluesky1024

window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function() {
    if (window.orientation === 180 || window.orientation === 0) {
      document.getElementsByTagName("html")[0].style.fontSize=document.documentElement.offsetWidth*12/375+"px"
    }
    if (window.orientation === 90 || window.orientation === -90 ){
      document.getElementsByTagName("html")[0].style.fontSize=document.documentElement.offsetWidth*12/375+"px"
    }
}, false);

分类:

技术点:

相关文章: