h5键盘弹出收起时引起的页面变化
export function keyboardMonitor() {
const originalHeight =
document.documentElement.clientHeight || document.body.clientHeight; //监听事件
window.onresize = () => {
return (() => {
const resizeHeight =
document.documentElement.clientHeight || document.body.clientHeight;
//软键盘弹起与隐藏 都会引起窗口的高度发生变化
console.log(resizeHeight, originalHeight);
const pageFooter = document.getElementsByClassName("page-footer");
if (resizeHeight * 1 < originalHeight * 1) {
// @ts-ignore
pageFooter[0].style.display = "none";
} else {
// @ts-ignore
pageFooter[0].style.display = "block";
}
})();
};
}