解决IOS键盘弹出后看不到输入框的问题

2018-05-09  本文已影响0人  杜乡的AGG

延迟是等键盘弹出后再去执行

setTimeout(function () {
      (function smoothscroll(){
        var currentScroll = document.documentElement.scrollTop || document.body.scrollTop;
        if (currentScroll > 0) {
          window.requestAnimationFrame(smoothscroll);
          window.scrollTo (0,currentScroll - (currentScroll/5));
        }
      })();
    },100)
上一篇 下一篇

猜你喜欢

热点阅读