We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 初版 export const keyboardUtil = { isIphone() { return false; }, init() { const originalHeight = document.documentElement.clientHeight || document.body.clientHeight; window.onresize = function resize() { // 键盘弹起与隐藏都会引起窗口的高度发生变化 const resizeHeight = document.documentElement.clientHeight || document.body.clientHeight; if (resizeHeight < originalHeight) { alert('展开'); } else { alert('收起'); } }; document.body.addEventListener('focusin', () => { // 软键盘弹出的事件处理 if (this.isIphone()) { alert('展开'); } }); document.body.addEventListener('focusout', () => { // 软键盘收起的事件处理 if (this.isIphone()) { alert('收起'); } }); } }; keyboardUtil.init();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: