解决苹果手机软键盘被关闭后依然占位的问题

输入框失去焦点时,强制让页面复位

$("input").blur(function(){
        setTimeout(() => {
        const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
        window.scrollTo(0, Math.max(scrollHeight - 1, 0));
        }, 100);
})

  

posted @ 2019-04-11 19:14  javenLee  阅读(452)  评论(0编辑  收藏  举报