简体   繁体   中英

Move footer above keyboard when it appear on mobile devices

I have found alot of artivles and posts here about how to hide footer when keyboard on mobile devices arise but not what I am trying to do which is opposite.

I want to move footer up above keyboard when keyboard is open.

HTML

<div class="wrapper">
<input type="text">
<div class="footer">Here Footer</div>
</div>

CSS

 .wrapper {
    position:relative;
    }
    .footer {
      width: 100%;
      background-color: #4c66a4;
      color: #fff;
      position: absolute;
      left: 0px;
      bottom: 0px;
      text-align: center;
    }

Any idea what am I doing wrong as it goes overflowed by keyboard all the time.

So it is not possible to stick div to the keyboard as keyboard on mobiles doesnt sit within viewport so. As i needed a numeric keyboard what I did is used jquery "KEY" functionality to make a keyboard based on divs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM