安卓输入框调起键盘后输入框自动上浮


if (/Android [4-6]/.test(navigator.appVersion)) {
window.addEventListener('resize', function () {
if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
window.setTimeout(function () {
document.activeElement.scrollIntoViewIfNeeded()
}, 0)
}
})
}
posted @ 2016-09-27 20:16  Vonson  阅读(1339)  评论(0编辑  收藏  举报