在做移动端网页的时候,需要对底部虚拟按键进行适配,达到百分百的效果,以下是适配代码:
function set_screen(wrap){
var s_height = document.body.clientHeight;
var s_width = document.body.clientWidth;
var proportion = s_height/s_width;
if(proportion<1.55){
var max_warp = document.querySelector(wrap);
max_warp.style.height = "37.55" + "rem";
document.ontouchmove = function(e){
}
}
}
set_screen(".wrap");