window.onload = function() { onsize() } window.onresize = function() { onsize() } function onsize() { var deviceWidth = document.documentElement.clientWidth; if (deviceWidth > 720) { deviceWidth = 720; } var fs = (deviceWidth * 100) / 720; document.documentElement.style.fontSize = fs + 'px'; }
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/229423.html原文链接:https://javaforall.net
