码迷,mamicode.com
首页 > 移动开发 > 详细

移动键盘 滚动input

时间:2019-01-08 19:36:02      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:resize   tag   fun   eve   func   size   active   put   lin   

window.addEventListener(‘resize‘, function () {
if(document.activeElement.tagName === ‘INPUT‘){
document.activeElement.scrollIntoView({behavior: "smooth"})
}
})

移动键盘 滚动input

标签:resize   tag   fun   eve   func   size   active   put   lin   

原文地址:https://www.cnblogs.com/chengyunshen/p/10240458.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!