彈出輸入框會使視口高度發生變化,彈出輸入框后動態匹配這個高度
以下是使用jq的方法
$('input').on('blur', function () {
setTimeout(function () {
var scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
}, 100);
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/154337.html
標籤:JavaScript
上一篇:為什么你應該使用 Object.is() 進行相等性比較(譯)
下一篇:js 字串方法 和 陣列方法總覽
