function rem() {
var t = 100,
o = 750,
e = document.documentElement.clientWidth || window.innerWidth,
n = Math.max(Math.min(e, 480), 320),
h = 50;
320 >= n && (h = Math.floor(n / o * t * .99)), n > 320 && 362 >= n && (h = Math.floor(n / o * t * 1)), n > 362 && 375 >=
n && (h = Math.floor(n / o * t * 1)), n > 375 && (h = Math.floor(n / o * t * .97)), document.querySelector("html").style
.fontSize = h + "px"
};
rem();
window.onresize = function() {
rem();
}
网友评论