ios13 微信輸入框逊拍,輸入完之后,body整體被頂上去豹悬,但按鈕相應(yīng)區(qū)域還在原地范抓。
可以試試:
$(document).ready(function () {
? ? ? $('body').height($('body')[0].clientHeight);
? });
? 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);
? ? ? }
? ? })
? }
? $("input,select,textarea").blur(function(){? ? ? ?
? ? ? setTimeout(function() {?
?? ? ? ? ? window.scrollTo(0,0);
? ? ? }, 100);? ?
? });
? document.body.addEventListener('touchmove', function (e) {
? ? ? e.preventDefault();
? }, {passive: false});