iPad Safari - 让键盘消失 [英] iPad Safari - Make keyboard disappear

查看:28
本文介绍了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?

间接地说,我正在寻找等效的(但在 Mobile 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-soft-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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆