Android/iPhone webkit,键盘弹出触发的事件? [英] Android/iPhone webkit, event triggered on keyboard pop?

查看:16
本文介绍了Android/iPhone webkit,键盘弹出触发的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在移动 webkit 上,当关注文本输入字段时,键盘会弹出.
在键盘滑动动画结束时是否有任何已知事件要绑定??

On mobile webkit, when focusing on a text input field, the keyboard pops up.
Is there any known event to bind on at the end of the keyboard slide animation??

推荐答案

显然不是:http://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW5

我在另一个线程上找到了最有用的信息:iPad 网络应用程序:在 Safari 中使用 JavaScript 检测虚拟键盘?

I found the most useful information on this other thread: iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari?

在 Android 上,我们可以使用 window.innerHeight 值检测到键盘向上,但在 iPhon 上,该值未更新...(这也无助于对齐底部的内容...)

on Android, we can detect that the keypad is up using the window.innerHeight value, but not on iPhon, the value is not updated... (which also does not help to align stuff at the bottom..)

所以我个人只是假设键盘在输入文本后 700 毫秒弹出......丑陋,但它有效!

so I personally just assume the keyboard is popped up 700ms after a text input is entered... ugly, but it works!

这篇关于Android/iPhone webkit,键盘弹出触发的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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