rem根据屏幕大小适配字体大小
(function(window, document) {
function rootSize() {
var screenWidth = document.documentElement.clientWidth || window.innerWidth;
// console.log(screenWidth);
var rootSize = screenWidth > 750 ? 100 :
screenWidth < 320 ? 320 / 750 * 100 : screenWidth / 750 * 100;
document.documentElement.style.fontSize = rootSize + 'px';
}
// window.addEventListener('DOMContentLoaded',rootSize);
window.onload = function() {
rootSize();
};
window.onresize = function() {
rootSize();
}
})(window, document);