size.js 867 B

1234567891011121314151617181920212223
  1. (function(doc, win) {
  2. var docEl = doc.documentElement,
  3. resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
  4. recalc = function() {
  5. var clientWidth = docEl.clientWidth;
  6. if (!clientWidth) return;
  7. if (clientWidth >= 750) {
  8. docEl.style.fontSize = '100px';
  9. } else {
  10. docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
  11. }
  12. };
  13. if (!doc.addEventListener) return;
  14. win.addEventListener(resizeEvt, recalc, false);
  15. doc.addEventListener('DOMContentLoaded', recalc, false);
  16. })(document, window)
  17. //获取地址栏参数
  18. function GetQueryString(name){
  19. var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
  20. var r = window.location.search.substr(1).match(reg);
  21. if(r!=null)return unescape(r[2]);
  22. return null;
  23. }