function resi() {
var html = document.querySelector("html");
var wW = document.body.clientWidth || document.documentElement.clientWidth;
var maxW = 640;
var minW = 320;
if (wW > maxW) wW = maxW;
var fT=wW/6.4+'px';
document.documentElement.style.fontSize=fT;
// var ratio = wW / minW;
// html.style.fontSize = 50 * ratio + "px";
}
window.addEventListener("DOMContentLoaded",
function() {
var bodys = document.querySelector("body").style;
bodys.opacity = "1";
bodys.filter = "alpha(opacity=100)";
resi()
});
window.addEventListener("resize", resi);
移動端js-基於rem自適應
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.