ontouch 函数在 iPhone 模拟器上没有被触发
在 iPhone 模拟器上,ontouch
的事件回调似乎不起作用。
以下内容似乎不适用于我的模拟器:
document.ontouch = function() {
alert('it works!');
}
尽管这确实返回 true:
if ('ontouch' in document) {
alert('touch supported');
}
还有其他人遇到此问题吗?
On the iPhone Simulator, the event callback for ontouch
doesn't seem to be working.
The following does not seem to work on my simulator:
document.ontouch = function() {
alert('it works!');
}
Although this does return true:
if ('ontouch' in document) {
alert('touch supported');
}
Has anyone else had this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有 3 个与触摸相关的事件:
尝试一下这些,应该没问题!
可以在本文中找到一些很好的示例:
http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/
There are 3 touch related events:
Try it with these and it should be OK!
Some good examples can be found with this article:
http://www.sitepen.com/blog/2008/07/10/touching-and-gesturing-on-the-iphone/