安卓手机输入法盖住输入框问题

移动端页面input获取焦点,底部弹出输入法盖住输入框,输入框不上推解决办法:

var ua = navigator.userAgent.toLowerCase(); 
if (/iphone|ipad|ipod/.test(ua)) { 
} else if (/android/.test(ua)) {   $("#building").focus(function(){     $(this).click(function(){         var SCROLLY=100;         var TIMER_NAME=500; // focus事件中500ms后进行判断         var MAX_SCROLL=150; // 越大越好       setTimeout(function() {         if(window.scrollY < SCROLLY) {         window.scrollTo(0, MAX_SCROLL);         }       }, TIMER_NAME);     })   }) }

  

posted @ 2017-06-09 15:06  流年之初,盛夏之末  阅读(500)  评论(0编辑  收藏  举报