After iOS OS input is complete, the keyboard does not bounce down

Source: Internet
Author: User

Encountered in the work, iOS system, after the input is completed, pop-up information, the keyboard does not bounce down, resulting in a bad user experience. My solution is to override the alert method

JS Code:

Window.alert=function () {
var shield = document.createelement ("DIV");
Shield.setattribute ("Class", "Alert_dialog");
var strhtml= "";
strhtml+= ' <div class= "Alert_dialog_con" > ";
strhtml+= ' <p> ' +str+ ' </p> ';
strhtml+= ' <button class= "alert_dialog_btn" onclick= "Dook ();" > Confirmation </button> ';
strhtml+= ' </div> ';
shield.innerhtml = strhtml;
Document.body.appendChild (shield);
This.dook = function () {
Shield.parentNode.removeChild (shield);
}
}

CSS code:

. alert_dialog {
Width:19rem;
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
Background:rgba (0, 0, 0, 0.6);
z-index:1999;
Display:block;
Transition:. 6s all ease;
Overflow-y: auto;
}
. Alert_dialog_con {
width:72%;
Margin:10rem Auto 0;
Background: #ffffff;
Padding:1rem;
Text-align:center;
border-radius:5px;
}
. Alert_dialog_con p{
Margin-top:1rem;
line-height:24px;
Font-size:0.8rem;
}
. alert_dialog_btn {
Width:5rem;
Height:2rem;
Margin-top:2rem;
Font-family: "Microsoft Jas Black";
border-radius:5px;
Margin-bottom:1rem;
}

After iOS OS input is complete, the keyboard does not bounce down

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.