安卓手机,软键盘把底部div顶上去解决方案:
<script>
//点击输入数字
window.onresize = function () {
var h = $(window).height();
var u = navigator.userAgent;
if ( u.indexOf(‘Android‘) > -1 || u.indexOf(‘Linux‘) > -1) {
if(h <= window.screen.availHeight/2){
document.getElementById(‘toNav‘).style.position = ‘relative‘;
}else{
document.getElementById(‘toNav‘).style.position = ‘fixed‘;
}
}
};
</script>
注:底部div的ID是“toNav”
原文:https://www.cnblogs.com/wanlibingfeng/p/11858542.html