标签:
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = ‘orientationchange‘ in window ? ‘orientationchange‘ : ‘resize‘,
recalc = function () {
window.clientWidth = docEl.clientWidth;
if (!window.clientWidth) return;
docEl.style.fontSize = 24 * (window.clientWidth / 750) + ‘px‘;
window.base = 24 * (window.clientWidth / 750);
};
try {
recalc();
} catch (e) {
}
if (!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener(‘DOMContentLoaded‘, recalc, false);
})(document, window);
标签:
原文地址:http://www.cnblogs.com/luckyXcc/p/5761659.html