Solution for fixed failure and hidden layer in click Blank when iOS eject soft keyboard

Source: Internet
Author: User

First, the implementation of click button Pop-up layer and click on the hidden layer of space, event.stoppropagation () is the key to prevent conduction.

<script type= "Text/javascript" >
$ (function () {
$ (' #btnShow '). Click (Function (event) {
event.stoppropagation ();
$ (' #div_apply '). Toggle ();
});
$ (document). Click (Function (Event) {$ (' #div_apply '). Hide ()});
})
</script>

Second, in iOS, the page uses position:fixed to locate the head or tail, and the page has input or textarea box, in the input box to get focus, pop-up soft keyboard, the original fixed in the end of the column will run to the middle of the page, The solution is to decide to change the positioning method to absolute positioning under iOS.

<script type= "Text/javascript" >
if (/iphone|ipad|ipod/i.test (navigator.useragent))
{
$ (". Head"). CSS ("position", "absolute");
};
</script>

Solution for fixed failure and hidden layer in click Blank when iOS eject soft keyboard

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.