(function (doc, win) {
let docEl = doc.documentElement
let resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
let recalc = function () {
var clientWidth = docEl.clientWidth
if (clientWidth) {
// html.fontSize = document.width / 设计图rem值 + px
docEl.style.fontSize = (clientWidth / 750) * 100 + 'px'
}
}
if (doc.addEventListener) {
win.addEventListener(resizeEvt, recalc, false)
doc.addEventListener('DOMContentLoaded', recalc, false)
}
})(document, window)
12-24
4106
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交