$("input,textarea").on("blur",function(){
setTimeout(function(){
window.scrollTo(0,0);
},100)
}).on('focus',function(){
var ua = navigator.userAgent;
var isAndroid = /android/i.test(ua);
if(isAndroid){
let Height = $('body').height();
$(window).resize(function() {
$('body').height(Height);
});
}else{
var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
var offsetTop = $(this).offset().top - (clientHeight / 4);
setTimeout(function(){
window.scrollTo(0,offsetTop);
},100)
}
})
ios h5页面 输入框失去焦点页面不复位,留白,输入框连续跳转,键盘未收起,遮挡页面
input textarea 失去焦点,将window滚动条复位,
当完成一个输入框,立即跳转至下一个输入框,键盘未收起,设置滚动条至相应位置
android
键盘弹出致使页面压缩,需设置页面高度