You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
384 B
JavaScript
13 lines
384 B
JavaScript
function getRem(pwidth,prem){
|
|
var html = document.getElementsByTagName("html")[0];
|
|
var oWidth = document.body.clientWidth || document.documentElement.clientWidth;
|
|
var size=oWidth/pwidth*prem;
|
|
html.style.fontSize = size + "px";
|
|
}
|
|
$(document).ready(function(){
|
|
//画布、字体大小设定
|
|
getRem(750,100);
|
|
$(window).resize(function() {
|
|
getRem(750,100);
|
|
})
|
|
}); |