【发布时间】:2011-11-03 18:54:39
【问题描述】:
如果我通过以下方式从移动设备捕获所有 touchend 事件:
$(document.body).bind('touchend', function (e) {
var touch = e.touches[0]; // doesnt work
...
我需要从 e 参数中获取 touch.screenX、touch.screenY、touch.clientX 和 touch.clientX。我看到的所有示例都表明 e.touches 将是一个集合,您可以通过e.touches[0] 获取触摸详细信息。在我对 ipad 的测试中,e.touches 始终未定义。我没有使用任何 jquery 插件。
也试过e.targetTouches,也是未定义的。
谁能帮忙?
【问题讨论】:
标签: javascript jquery touch mobile-safari touch-event