After the mobile input box gets the focus, the virtual keyboard pops up and pushes up the fixed bottom. How to solve the problem?

as shown in the picture, how to solve the problem perfectly

Mar.03,2021

Virtual keyboard pops up to hide the bottom, otherwise, you can focus on the (onfocus), out-of-focus (onblur) event by monitoring the input box


this is the mobile layout pit. Wrap up your content and add
.main {

  position: fixed;
  top: 0px;
  bottom: 50px;
  overflow-y: scroll;

}


    /**/
    let winHeight = window.innerHeight
    window.addEventListener('resize', function() {
      if (winHeight > window.innerHeight) {
        /**/
        document.getElementsByTagName('body')[0].setAttribute('height', winHeight+'px')
      }else {
        /**/
        document.getElementsByTagName('body')[0].setAttribute('height', '100%')
      }
    })

give it a try.

  • Conversion between px and rem on Mobile

    when I was reading the article today, I saw a piece of code that I didn t quite understand, so I would like to ask for advice here. article address: https: www.cnblogs.com azhai. Code snippets that you don t understand: docEl.style.fontSize = 20...

    Mar.25,2021
  • Mobile special effects problem

    https: www.apple.com cn ios . the problem of sliding special effects viewed on Apple s official website on the mobile side. in F12, I found that the z-index attribute of each < session > tag is arranged from big to small, but there is no train of ...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30f47-2b5a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30f47-2b5a2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?