最近在微信前端页面开发过程中遇到一个问题,当把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);