You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
592 B
14 lines
592 B
new function (){
|
|
var _self = this;
|
|
_self.width = 640;//设置默认最大宽度
|
|
_self.fontSize = 100;//默认字体大小
|
|
_self.widthProportion = function(){var p = (document.body&&document.body.clientWidth||document.getElementsByTagName("html")[0].offsetWidth)/_self.width;return p<0.5?0.5:p;};
|
|
_self.changePage = function(){
|
|
document.getElementsByTagName("html")[0].setAttribute("style","font-size:"+_self.widthProportion()*_self.fontSize+"px !important");
|
|
}
|
|
_self.changePage();
|
|
window.addEventListener("resize",function(){_self.changePage();},false);
|
|
};
|
|
|
|
|
|
|
|
|