HTML5虚拟键盘出现挡住输入框怎么办
来源:动视网
责编:小OO
时间:2020-11-27 15:06:41
HTML5虚拟键盘出现挡住输入框怎么办
话不多说,请看代码。;部分安卓机型适用。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);} })}。
导读话不多说,请看代码。;部分安卓机型适用。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);} })}。

本文主要介绍了HTML5 虚拟键盘出现挡住输入框的解决办法。具有很好的参考价值,下面跟着小编一起来看下吧,希望能帮助到大家。
话不多说,请看代码:
部分安卓机型适用。
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);
}
})
}
HTML5虚拟键盘出现挡住输入框怎么办
话不多说,请看代码。;部分安卓机型适用。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);} })}。