Mobile soft keyboard pop-up affects layout

Source: Internet
Author: User

Mobile soft keyboard pop-up affects layout

1) The previous period of time for the mobile page, because the height of only 1 pages, so used height:100%;width:100%;

The layout has no big impact when you click the input box to eject the soft keyboard under iOS.

When the input box may be pressed by the soft keyboard, there is a problem with some Android, Huawei's own browser and UC will have layout problems.

The reason may be because, when the soft keyboard pops up, it changes the height so that the height:100% cannot reach the original height.

Workaround:

$ (document). Ready (function () {
$ (' body '). Height ($ (' body ') [0].clientheight);
});

After loading the page, JS gives the body a fixed height.

2) also encountered before, the mobile side click on the input box, the page offset a part of the left, but too long, forget what browser, and can not reproduce, the solution is to make the size of the input box center.

PS: Under the Spit slot Huawei comes with a browser and UC does not recognize CSS3 's new unit, VW,VH.

Mobile soft keyboard pop-up affects layout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.