input textbox hidden behind keyboard on android Chrome

后端 未结 7 655
梦毁少年i
梦毁少年i 2020-12-13 13:49

I have a mobile web page of the following format:

header - logo etc - absolute positioned

content - scrollable, absolute positioned

footer, 40px abs

7条回答
  •  轮回少年
    2020-12-13 14:08

    If you use jQuery, you can use the codes as follow:

    $('body').on('focusin', 'input, textarea', function(event) {
      if(navigator.userAgent.indexOf('Android') > -1 && ...){
       var scroll = $(this).offset();
       window.scrollTo(0, scroll);
     }
    });
    

    Though, the bug should be solved now.

提交回复
热议问题