(function(doc, win) {
var docEl = doc.documentElement;
function adaptScreen(){
var deviceWidth = docEl.clientWidth;
deviceWidth = deviceWidth < 1366 ? 1366 : deviceWidth;
var rate = (deviceWidth / 1366) * 625;
docEl.style.fontSize = rate + "%";
}
win.addEventListener("resize", adaptScreen, false);
doc.addEventListener('DOMContentLoaded', adaptScreen, false);
})(document, window);
网友评论