How to fix Android phone keyboard popup will compress page

Source: Internet
Author: User

Many times in the project we need to use the input box Input,input focus will call the phone keypad, this time we if the current page maximum element width is the actual pixel, it is not a problem, but if the writing is hundred percent on the Android machine on the current page will be compressed upward, But mobile side we have to make adaptive, we can not write a fixed width high, then how to solve, first we could get the current mobile device width and height, and then to the current page write wide, plus position:fixed;

<style>

. page{position:fixed;

left:0;

top:0; }

</style>

var x =document.body.clientwidth;

var y =document.body.clientheight;

$ (". Page"). width (x);

$ (". Page)." Height (y);

How to fix Android phone keyboard popup will compress page

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.