// 动态适配终端计算 js
function autoResizeDev() {
var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
var htmlDom = document.getElementsByTagName('html')[0];
//判断pc、移动端
htmlWidth > 768 ? htmlDom.style.fontSize = '100px' : htmlDom.style.fontSize = htmlWidth / 7.5 + 'px';
}
autoResizeDev();
window.onresize = autoResizeDev;
网友评论