//解决iPhoneX软键盘收起后页面没有正确归位的问题
function isIos () {
let u = navigator.userAgent
return !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
}
if (isIos()) {
let isReset;
$('body').focusout(()=>{
isReset = true;
setTimeout(() => {
if (isReset) window.scroll(0, 0);
// document.body.scrollTop = document.body.scrollTop
}, 100);
}).focusin(()=>{
isReset = false;
})
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)