Android H5 soft keyboard occlusion input box

Source: Internet
Author: User

<Divclass= "Label">                    *                    <span><?php echo Lang (' Receive_email_info ');?></span>                    <inputclass= "R-email"type= "text"placeholder= "<?php echo lang (' Please_in_receive_email ');? >3333">                </Div>                <Divclass= "Label">                    *                    <span><?php echo Lang (' Alipay_binding_vcode ');?></span>                    <inputclass= "R-code"type= "text"placeholder= "<?php echo lang (' Please_input_code ');?>">                    <inputtype= ' button 'class= "Get-code2"value= ' <?phpecho Lang (' Get_captcha ');?>' ></Div>
varIsredundant =false; $('. R-email,.r-code '). On (' Blur ',function() {setTimeout (function(){                    if(isredundant) {isredundant=false; }Else{                        $('. Redundant_div '). CSS (' display ') = ' None '                    }                }, 100)        })        $(' input[type= ' text "],textarea '). On (' Focus ',function () {            if($( This). attr (' class ') = = ' R-email ' | | $( This). attr (' class ') = = ' R-code ') {                if($ ('. Redundant_div '). length > 0) {alert ($ ('. Redundant_div '). CSS (' display ') = = ' None ')                    if(!$ ('. Redundant_div '). CSS (' display ') = = ' None ') {alert (12314) Isredundant=true; } setTimeout (function(){                        $('. Redundant_div '). CSS (' display ') = ' block '                    },150)                }Else{                    $('. Personal-data '). Append (' <div class= "Redundant_div" style= "Width:100%;height:200px;background:blue;" ></div> ') SetTimeout (function(){                        $('. Redundant_div '). CSS (' display ') = ' block '                    },150)}} setTimeout (function(){                    //if (target.scrollintoviewifneeded) {                    //target.scrollintoviewifneeded ();                    // }                                        if(' scrollIntoView 'inchdocument.activeelement) {Document.activeElement.scrollIntoView (); } Else{document.activeElement.scrollIntoViewIfNeeded (); }            },400); });

Because some Android H5 soft keyboard will obscure the input box

1.

scrollIntoView can allow obscured elements to be displayed in the viewable area
2. If input is at the bottom of the page and there is no extra space underneath to scroll, insert the blank element manually and then use
scrollIntoView Handling of element positions

Android H5 soft keyboard occlusion input box

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.