如果我使用以下代码捕获来自移动设备的所有touchend事件:
$(document.body).bind('touchend', function (e) {
var touch = e.touches[0]; // doesnt work
...
我需要从e参数中获取touch.screenX、touch.screenY、touch.clientX和touch.clientY。我看到的所有例子都建议使用e.touches来获取触摸详细信息,例如e.touches[0]
。但在我的iPad测试中,e.touches
始终为undefined。我没有使用任何jQuery插件。
我还尝试了e.targetTouches,但也是undefined。
有人能帮忙吗?