估计导航用的fixed定位吧,
var windheight =window.innerHeight;
var bottomx = document.getElementById('bottomx'); //底部导航
window.onresize(function(){ var docheight = window.innerHeight;
if(docheight < windheight){
bottomx.style.position = 'static';
}else{
bottomx.style.position = 'fixed';
}
})
你底部用的一定是fixed定位吧...你可以再文本框获取焦点事件的时候把底部导航隐藏或者改成absolute
1.html
2.js
var h = document.body.scrollHeight;
window.onresize = function(){
if (document.body.scrollHeight < h) {
document.getElementsByTagName("nav")[0].style.display = "none";
}else{
document.getElementsByTagName("nav")[0].style.display = "block";
}
};