ug环球会员注册,ug环球官网
// let c = new VConsole();
!(function (win, doc) {
function setFontSize() {
// 获取window 宽度
// zepto实现 $(window).width()就是这么干的
var winWidth = window.innerWidth || window.screen.availWidth || document.body.clientWidth || 540;
if (winWidth > 750) {
winWidth = 500
}
doc.documentElement.style.fontSize = (winWidth / 750) * 100 + 'px';
}
var evt = 'onorientationchange' in win ? 'orientationchange' : 'resize';
var timer = null;
win.addEventListener(evt, function () {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}, false);
win.addEventListener("pageshow", function (e) {
if (e.persisted) {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}
}, false);
//初始化
setFontSize();
}(window, document));