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"; } })(); }; }
上一篇:spring boot的项目+nginx,怎么预防点击劫持(clicekJacking)


下一篇:计算机网络-步骤