<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