Mobile keyboard Masking input issues

Source: Internet
Author: User

When developing a mobile project, the test proposes an optimization problem, namely:

input Gets the focus popup system virtual keyboard when input is blocked by the keyboard (PS: This issue is only available on Android phones, iOS systems are automatically processed).

The solution is:

When input takes focus, gets the distance of input in the page relative to the half of the screen thistop, then adds a div to the body , the height is thistop+50, The scrolltop of the page is then set to THISTOP+50, which guarantees that input gets the focus in the middle of the screen;

Hide the dynamically added div when the input is complete.

If there is inaccurate expression, welcome to correct, welcome to add, thank you for reading!

Mobile keyboard Masking input issues

Related Article

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.