移动端h5页面,当软键盘弹出时,会将底部导航footer顶上去,怎么解决???

移动端h5页面,当软键盘弹出时,会将底部导航footer顶上去,怎么解决???

这个需要你js来判断下
var oHeight = $(document).height(); //浏览器当前的高度

$(window).resize(function(){

    if($(document).height() < oHeight){

    $("#footer").css("position","static");
}else{

    $("#footer").css("position","absolute");
}

});


$('body').height($('body')[0].clientHeight);

footer的css属性position: fixed。如果ios客户端用的UIWebview内核,在ios11下可能会存在渲染问题,建议使用 animation来解决此问题。

footer的样式写固定在底端

建议你可以先设置一个DIV(记得设置他的大小宽高),然后设置over-flow:hidden属性,这样子就顶不上去了

给footer开一个固定定位,固定在底部