0

I want to detect a keyboard of a smartphone when it comes up.

now i got this, if the input is focussed then it does something

<script>
$( "#gebruikersnaam" ).focus(function() {
    $("#header").css("display", "none");
});
$( "#gebruikersnaam" ).focusout(function() {
    $("#header").css("display", "block");
});
$( "#wachtwoord" ).focus(function() {
    //alert( "Wachtwoord" );
});
$( "#hwachtwoord" ).focus(function() {
    //alert( "herhaal wachtwoord" );
});
</script>

is there a way if the keyboard is coming that jquery or css can detect it? this code works for 80% but if i use the back button instead of unfocus the code doesn't work.

Erwin
  • 111
  • 2
  • 11
  • 1
    Please see http://stackoverflow.com/questions/2593139/ipad-web-app-detect-virtual-keyboard-using-javascript-in-safari – Pratik Joshi Mar 06 '15 at 15:22
  • thats the same that i coded above. – Erwin Mar 06 '15 at 15:32
  • http://stackoverflow.com/questions/13270659/detect-virtual-keyboard-vs-hardware-keyboard maybe get some ideas off of this? – Sai Mar 06 '15 at 15:36
  • Here is also a workaround I found online..http://jsfiddle.net/UHdCw/8/ . Basically detects if screen size changes and adds/ removes class based on it – Sai Mar 06 '15 at 15:39
  • http://stackoverflow.com/questions/6196195/android-iphone-webkit-event-triggered-on-keyboard-pop – Sai Mar 06 '15 at 15:44

0 Answers0