没有任何输入字段的 iPad 输入
我想为 iPad 编写一个简单的“C is for Cat”程序。用户按下 C 虚拟键,一只猫就会出现并喵喵叫。
问:使用 jQuery 和/或 jQuery mobile,如何在屏幕上没有任何输入控件的情况下显示键盘?
I'd like to write a simple "C is for Cat" program for the iPad. The user presses the C virtual key and a cat shows up and meows.
Q: Using jQuery and/or jQuery mobile, how can I have the keyboard appear without there being any input controls on the screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是 100% 确定 iPad Safari 中存在的所有浏览器挂钩,但我真的不认为有一种方法可以在不首先关注某种输入字段的情况下触发此功能。
也许您可以创建一个隐藏的文本输入字段,然后将其焦点放在页面加载上?然后,当他们键入字符时,您可以侦听 onChange 事件并做出适当的反应。
除此之外,我认为没有办法捕获按键操作。
I'm not 100% sure of all of the browser hooks present in iPad's Safari, but I really don't think there's a way to trigger this without first focusing on an input field of some sort.
Perhaps you could create a hidden text input field and then give it focus upon page load? Then when they type characters, you could listen for the onChange event and react appropriately.
Other than that, I don't think there's a way to capture key presses.
凉爽的。试试这个:
嗯...我唯一能建议的就是制作一个巨大的隐形
Cool. Try this:
Hmm...only other thing I can suggest is to make a giant invisible
<textarea />
...? Then get the user to tap it.