当前位置: 代码迷 >> 综合 >> 移动端本机软键盘导致页面出现空白
  详细解决方案

移动端本机软键盘导致页面出现空白

热度:94   发布时间:2024-02-23 22:45:27.0
//多个输入框问题
$("input,textarea").on("blur",function(){setTimeout(function(){window.scrollTo(0,0);},100)
}).on('focus',function(){var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;var offsetTop = $(this).offset().top - (clientHeight / 4);setTimeout(function(){window.scrollTo(0,offsetTop);},100)
})
  相关解决方案