話不多說,請看代碼:
//防止鍵盤把當前輸入框給擋住$$('input[type="text"],textarea').on('click', function () { var target = this; setTimeout(function(){ target.scrollIntoViewIfNeeded(); },100);});
部分安卓機型適用。
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); } })}
以上就是本文的全部內容,希望本文的內容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持VeVb武林網!
新聞熱點
疑難解答