Skip to content Skip to sidebar Skip to footer

Show Hide Keyboard Is Not Working Propery In Android Phonegap

i follow this link to use the keyboard event by using [Simon mac donald Defination][1] In that event i show my footer when keyboard hide and hide my footer when keyboard is show.wh

Solution 1:

Remove the .ready() function and add the listeners in the deviceready

<styletype="text/css">#footer {
    position:absolute;
    bottom:0; left:0;
    width:100%;
    height:7%;
    background-color:#00458D;
    padding:0;
    border-width:3px;
    padding-top:3%;
    padding-bottom:2%;
    padding-right:0px;
    padding-left:0px;
    background-color:#00458D;
}

#content {
    position:absolute; bottom:0;
    top:0;
    width:100%;
    overflow:auto;
}
</style><scripttype="text/javascript">document.addEventListener("deviceready",onDeviceReady,false);

    functiononDeviceReady () {
        document.addEventListener("hidekeyboard", onHide, false);
        document.addEventListener("showkeyboard", onShow, false);

    }
    functiononHide() 
    {
        $("#footer").show();
    }

    functiononShow() 
    {
        $("#footer").hide();
    }
    </script></head><body ><divid="content"><inputtype="text"style="width=70%"><br/><br/><divid="footer"align="center"><tablewidth=100%><inputtype="image"src="../images/Home.PNG"style="width:23%"onClick="home()"/><inputtype="image"src="../images/messages-menu.jpg"style="width:23%"onClick="inbox()"/><inputtype="image"src="../images/settings-menu.jpg"style="width:23%"onClick="settings()"/><inputtype="image"src="../images/close-menu.png"style="width:23%"onClick="callServiceFunction()"/></table></div></div></body></html>

Solution 2:

Try it in OndeviceReady ()

 $(document).ready(function () 
 {
      document.addEventListener("deviceready", onDeviceReady, false);
 }
 functiononDeviceReady()
 {

     document.addEventListener("hidekeyboard", onHide, false);
     document.addEventListener("showkeyboard", onShow, false);

 }
 functiononHide() 
 {
       $("#footer").show();
 }
 functiononShow() 
 {
       $("#footer").hide();
 }

Post a Comment for "Show Hide Keyboard Is Not Working Propery In Android Phonegap"