1
This commit is contained in:
14
public/static/theme/index/js/font.js
Normal file
14
public/static/theme/index/js/font.js
Normal file
@ -0,0 +1,14 @@
|
||||
(function (doc, win) {
|
||||
var docEl = doc.documentElement,
|
||||
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
|
||||
recalc = function () {
|
||||
var clientWidth = docEl.clientWidth;
|
||||
if (!clientWidth) return;
|
||||
docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
|
||||
};
|
||||
|
||||
if (!doc.addEventListener) return;
|
||||
win.addEventListener(resizeEvt, recalc, false);
|
||||
doc.addEventListener('DOMContentLoaded', recalc, false);
|
||||
})(document, window);
|
||||
|
||||
Reference in New Issue
Block a user