window.onresize = function () { var ua = navigator.userAgent; var isAndroid = /android/i.test(ua); //android终端 if(isAndroid) { if (document.activeElement.tagName == "INPUT" || document.activeElement.tagName == "TEXTAREA") { window.setTimeout(function() { document.activeElement.scrollIntoViewIfNeeded(); },0); } } }
文章转载于:https://www.jianshu.com/p/bc4ab3f154f5
原著是一个有趣的人,若有侵权,请通知删除
还没有人抢沙发呢~