【问题标题】:jQuery mobile - iOS - How to detect when the keyboard is opening?jQuery mobile - iOS - 如何检测键盘何时打开?
【发布时间】:2012-01-26 06:32:22
【问题描述】:

我正在开发一个 jQuery 移动网站,需要在 iOS 键盘显示或隐藏时更新我的​​布局。

我可以绑定一些事件吗?不一定必须是 JQM 事件,任何其他事件也足够了。

感谢您的帮助!

【问题讨论】:

  • 这将与其他表单元素类似,例如模糊和焦点事件...
  • 在我看来,附加 resize 事件就可以了,您可以检查 innerWidth/innerHeight 并更改布局。虽然我刚刚读到 Safari 更改了 innerHeight 值而没有触发resize。多么奇怪。

标签: jquery ios events jquery-mobile keyboard


【解决方案1】:

jQuery Mobile 不提供 iOS 键盘打开时的事件。你可以bind the focus and onblur events to handle this instead

【讨论】:

    猜你喜欢
    • 2016-02-20
    • 2018-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多