解决键盘弹出底部导航被顶上来的bug

Posted 捞少

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决键盘弹出底部导航被顶上来的bug相关的知识,希望对你有一定的参考价值。

代码如下:

function focus_footer(h){
    window.onresize = function() {
      if (document.body.scrollHeight < h) {
        document.getElementById(‘footer‘).style.display = "none";
      } else {
        document.getElementById(‘footer‘).style.display = "block";
      }
    };
}

最后一步就在需要的页面执行:

var h = document.body.scrollHeight;
focus_footer(h);

 

以上是关于解决键盘弹出底部导航被顶上来的bug的主要内容,如果未能解决你的问题,请参考以下文章