rem 响应 js函数

size();
window.onresize = function(){
size();
}
function size(){
var htnl_o=document.getElementsByTagName("html")[0];
htnl_o.style.fontSize = window.innerWidth/375*20 + "px";
console.log(htnl_o.style.fontSize);
}

posted on 2017-03-26 17:52  童彪  阅读(191)  评论(0编辑  收藏  举报

导航