vue页面初始化大小rem,自适应效果设置
window.onload = function(){getRem(750,100)};window.onresize = function(){getRem(750,100)};function getRem(pwidth,prem){var html = document.getElementsByTagName("html")[0];var oWidth = ...
·
window.
onload =
function(){
getRem(
750,
100)
};
window.
onresize =
function(){
getRem(
750,
100)
};
function
getRem(
pwidth,
prem){
var
html =
document.
getElementsByTagName(
"html")[
0];
var
oWidth =
document.
body.
clientWidth ||
document.
documentElement.
clientWidth;
html.
style.
fontSize =
oWidth/
pwidth*
prem +
"px";
}
更多推荐
已为社区贡献12条内容
所有评论(0)