iPad Safari - 让键盘消失 [英] iPad Safari - Make keyboard disappear
本文介绍了iPad Safari - 让键盘消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iPad Safari浏览器中,当我将焦点从文本框更改为下拉列表时,键盘仍然存在...是否有某种方式(可能使用Javascript)当用户从文本框中模糊时,我可以隐藏键盘?
In iPad Safari browser, when I change focus from a textbox to a dropdown, the keyboard still remains... Is there some way (maybe with Javascript) I can hide the keyboard when user blurs from the textbox?
间接地说,我正在寻找相当于(但在移动Safari中)
Indirectly speaking, I am looking for a equivalent of (but in Mobile Safari)
[tempTextField resignFirstResponder];
推荐答案
我在 http://uihacker.blogspot.com/2011/10/javascript-hide -ios-软keyboard.html 。基本上,只需这样做(它对我有用):
I found the solution for this at http://uihacker.blogspot.com/2011/10/javascript-hide-ios-soft-keyboard.html. Essentially, just do this (it worked for me):
var hideKeyboard = function() {
document.activeElement.blur();
$("input").blur();
};
这篇关于iPad Safari - 让键盘消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文