ios 输入框失去焦点,位置回调方法

微信网页开发,ios 在input,textarea 失去焦点后,页面无法回调。

以下方法可解决:

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

 

posted @ 2019-10-25 15:45  yiruiheng  阅读(698)  评论(0编辑  收藏  举报