Use a timer to monitor window.innerheight height changes to determine. Trigger keyboard Other places also have event response
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "><script type=" Text/javascript "src=" Http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2.min.js "></" Script><input type= "text" id= "TXT"/><div id= "DV" ></div><script> var timer, Windowinnerheight; function Eventcheck (e) {if (e) {//blur,focus event-triggered $ (' #dv '). html (' Android keyboard ' + (E.type = = ' Focus '? ' Eject ': ' hide ') + '--through ' + E.type + ' event '); if (E.type = = ' click ') {//If the Click event Launch timer monitors whether the button is clicked on the hidden keyboard button on the keyboard, there is no event available to click on the buttons, KeyDown also gets keycode value SetTimeout (func tion () {///because the keyboard popup is animated, to get the full pop-up window height, use the timer windowinnerheight = window.innerheight;//get the window that pops up the Android soft keyboard Mouth Height timer = setinterval (function () {Eventcheck ()}, 100); }, 500); } else Clearinterval (timer); } else {//timer execution, need to determine the window visual height, if the change indicates that the Android keyboard hidden if (Window.innerheight > Windowinnerheight) {clearinterval (timer); $ (' #dv '). html (' Android keyboard hidden--by clicking the keyboard hide button '); }}} $ (' #txt '). Click (Eventcheck). blur (Eventcheck);</script>
Hide the keyboard and perform events
when the phone endpoint hits the keyboard and cannot get the part of the KeyCode value