12345678910111213 |
- // 自定义
- (function () {
- var recalc = function () {
- var width = document.documentElement.offsetWidth
- var fontSize = 100 / 1240 * width
- document.querySelector('html').style.fontSize = (fontSize) + 'px'
- }
- window.addEventListener('resize', recalc, false)
- document.addEventListener('DOMContentLoaded', recalc, false)
- recalc()
- })()
|