h5页面宽度设置7.5rem

function ready() {
                var u = navigator.userAgent;
                var winW = document.documentElement.clientWidth;
                if (!!!u.match(/AppleWebKit.*Mobile.*/)) {
                    winW = 414;
                    document.getElementsByClassName('wraper')[0].style.width = '' + winW + 'px';
                }
                document.documentElement.style.fontSize = winW / 7.5 + 'px';
            }
            ready();
            window.addEventListener("resize", ready, false);

 

posted @ 2018-12-18 11:37 小泉哥哥 阅读(...) 评论(...) 编辑 收藏