(function adaptation() { var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'; function resize() { var html = document.documentElement; var wd = html.clientWidth; if (wd >= 750) { wd = 750 } html.style.fontSize = wd / 7.5 + 'px'; } resize(); var timer; window.addEventListener(resizeEvt, function () { timer && clearTimeout(timer); timer = setTimeout(resize, 300) }); document.addEventListener('DOMContentLoaded', resize); })()