Touch screen version of the phone to automatically eject the keyboard to meet the three conditions:
1. text Box get focus
2, hand touch screen of this page
3. No delay
Implementation examples (similar to Weibo):
<! DOCTYPE html>
<meta charset= "Utf-8" >
<meta http-equiv= "x-ua-compatible" content= "Ie=edge" >
<meta name= "viewport" content= "Width=device-width, initial-scale=1" >
<style>
. page{
width:100%;
height:400px;
Background: #333;
Overflow:hidden;
}
. Page a{
Display:block;
width:50px;
height:50px;
margin:100px Auto;
}
. com {
Display:none;
width:100%;
height:500px;
Overflow:hidden;
}
. com textarea{
Display:block;
width:90%;
height:200px;
margin:50px Auto;
}
</style>
<body>
<div class= "Page" >
<a href= "javascript:void (0);" > Reviews </a>
</div>
<div class= "com" >
<textarea></textarea>
</div>
</body>
<script>
$ ('. Page a '). On (' click ', function () {
$ ('. Page '). Hide ()
$ ('. com '). Show ()
$ ('. com textarea '). Focus ()
})
</script>
Touch screen version similar to refresh the page text box to get focus while popping the phone keyboard practice