The input end of the input box moves from the top page, the problem can not hide the keyboard restoring page

I believe we usually will encounter this problem, move the cursor to the end input or textarea get the whole page is the top up, put away the keyboard, the page does not recover problem

====>>>> 

 

 

I am here offers two solutions:

1. For vue.js

HTML:
 < INPUT V-Model = "workWhere" @blur = "changBlur" > 

JS: 
 Methods: { 
     changBlur () { 
        window.scroll (0,0); // make the page made out Jiaohou Jiang homing 
     } 
}

 

2. For native or JQ

 

 

< Div class = "Box" > 
           < INPUT placeholder = "select" > 
</ div > 


$ ( "INPUT Box.") ON ( "Blur", function () {. 
        Window.scroll (0,0); / / loss Jiaohou Jiang made to make the page homing 
});

                    

 

Guess you like

Origin www.cnblogs.com/520BigBear/p/12343489.html