(
function (doc, win) {
var docEl = doc.documentElement,
resizeEvt =
'orientationchange'
in
window ?
'orientationchange' :
'resize',
recalc =
function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth)
return;
if(clientWidth>=
640){
docEl.style.fontSize =
'50px';
}
else{
docEl.style.fontSize =
100 * (clientWidth /
750) +
'px';
}
};
if (!doc.addEventListener)
return;
win.addEventListener(resizeEvt, recalc,
false);
doc.addEventListener(
'DOMContentLoaded', recalc,
false);
})(
document,
window);
(
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 =
20 * (clientWidth /
320) +
'px';
};
if (!doc.addEventListener)
return;
win.addEventListener(resizeEvt, recalc,
false);
doc.addEventListener(
'DOMContentLoaded', recalc,
false);
})(
document,
window);
function resize(originSize,type){
var type=type||
"x";
var widths=
document.documentElement.clientWidth;
var heights=
document.documentElement.clientHeight;
if(type==
"x"){
var scale=widths/originSize*
100;
}
else
if(type==
"y"){
var scale=heights/originSize*
100;
}
document.getElementsByTagName(
"html")[
0].style.fontSize=scale+
"px";
}
resize(
750,
"x");