找回密码
雪球 门户 今日价格 查看内容

?

2020-1-13 16:01| 发布者: admin| 查看: 58| 评论: 0

摘要: (function(base, min, max, scaling){ var cacheWidth = 0; var timer; var docEl = document.documentElement; var resizeEvt = 'onorientationchange' in window ? 'orientationchange' : 'resize'; var recalc = ...
(function(base, min, max, scaling){ var cacheWidth = 0; var timer; var docEl = document.documentElement; var resizeEvt = 'onorientationchange' in window ? 'orientationchange' : 'resize'; var recalc = function () { var clientWidth = docEl.clientWidth; if (!clientWidth) return; clientWidth = Math.min(clientWidth, max); clientWidth = Math.max(clientWidth, min); if(cacheWidth !== clientWidth) { clearInterval(timer); cacheWidth = clientWidth; docEl.style.fontSize = scaling * (clientWidth / base) + 'px'; } } if (!document.addEventListener) return; window.addEventListener(resizeEvt, function() { timer = setInterval(recalc, 10); }); recalc(); })(375, 300, 375, 100); (function(base, min, max, scaling){ var cacheWidth = 0; var timer; var docEl = document.documentElement; var resizeEvt = 'onorientationchange' in window ? 'orientationchange' : 'resize'; var recalc = function () { var clientWidth = docEl.clientWidth; if (!clientWidth) return; clientWidth = Math.min(clientWidth, max); clientWidth = Math.max(clientWidth, min); if(cacheWidth !== clientWidth) { clearInterval(timer); cacheWidth = clientWidth; docEl.style.fontSize = scaling * (clientWidth / base) + 'px'; } } if (!document.addEventListener) return; window.addEventListener(resizeEvt, function() { timer = setInterval(recalc, 10); }); recalc(); })(375, 300, 375, 100);

鲜花

握手

雷人

路过

鸡蛋
雪球

Powered by Discuz! X3.4 © 2001-2012 Comsenz Inc. Designed by 999test.cn & 雪球

GMT+8, 2020-10-20 11:48 , Processed in 0.100961 second(s), 17 queries .

返回顶部