字体大小变动js控制

2016-09-21  本文已影响0人  greenlift
            window.onload = function() {
            fontSize();
                function fontSize () {
                    var w = window.innerWidth / 10;
                    var html = document.querySelector("html");
                    html.style.fontSize = w + "px";
                }
                window.onresize = fontSize;
            }
        </script>```
上一篇 下一篇

猜你喜欢

热点阅读