H5界面,打开键盘,整体页面被顶起,页面变形。。记录。。
$("input").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)
}
})