Created
March 5, 2014 10:41
-
-
Save Haraldson/9364940 to your computer and use it in GitHub Desktop.
Hide virtual keyboard on devices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hideVirtualKeyboard(os) | |
{ | |
$('input, textarea').blur(); | |
if(os === 'iOS') | |
document.activeElement.blur(); | |
if(os === 'Android') | |
{ | |
var $field = $('<input type="text">'); | |
$('body').append($field); | |
window.setTimeout(function() | |
{ | |
$field.focus(); | |
window.setTimeout(function() | |
{ | |
$field.hide(); | |
}, 50); | |
}, 50); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment