<script>
(function(win, doc) {
var docWidth = doc.documentElement.clientWidth;
if(docWidth <320){
docWidth = 320
}
var rem = docWidth / 10.8;
doc.documentElement.style.fontSize = rem + 'px';
win.addEventListener('resize', function() {
if(doc.documentElement.clientWidth >320) {
rem = doc.documentElement.clientWidth / 10.8;
doc.documentElement.style.fontSize = rem + 'px';
}
}, false);
})(window, document);
</script>
根据屏幕动态设置fongtSize大小
最新推荐文章于 2022-10-19 20:13:27 发布