function setRootFont() {
var screenWidth = window.innerWidth > 768 ? 768 : window.innerWidth;
var rootFontSize = screenWidth / 375 * 100;
document.getElementsByTagName('html')[0].style.fontSize = rootFontSize + "px";
}
setRootFont();
window.onresize = setRootFont;
网友评论