解决body,html高度设置为100%时,安卓手机弹起键盘时,其高度变为可见高度的问题

最近在微信前端页面开发过程中遇到一个问题,当把body,html高度设置为100%时,在安卓手机弹起键盘的时候,其高度变为可见高度,影响页面的显示,解决方法如下:

var screenHeight;
    if (window.innerHeight){
        screenHeight = window.innerHeight;
    } else if ((document.body) && (document.body.clientHeight)){
        screenHeight = document.body.clientHeight;
    }
    $("html,body").height(screenHeight);

你可能感兴趣的:(问题记录总结)