fun utf active focus view style cnblogs input
- //处理input focus时被键盘遮挡问题
- inputFocus: function() {
- 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);
- }
- })
- }
- },
h5 开发安卓软键盘遮挡解决方案
来源: http://www.bubuko.com/infodetail-2026965.html