标签:document class ret cti res window log hang eve
/* fix the code flash the page */ var globalWidth = document.documentElement.clientWidth;//window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var radixNO = 100/750*globalWidth; document.documentElement.style.fontSize = radixNO + ‘px‘; /* fit document fit the screen, get the radix */ (function (doc, win) { var docEl = doc.documentElement, resizeEvt = ‘orientationchange‘ in window ? ‘orientationchange‘ : ‘resize‘, recalc = function () { var globalWidth = window.innerWidth;// for judge the screen ?? 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);
标签:document class ret cti res window log hang eve
原文地址:http://www.cnblogs.com/lengyue0030/p/7562862.html