jQuery live()删除iPhone touch事件属性? [英] jQuery live() removing iPhone touch event attributes?

查看:149
本文介绍了jQuery live()删除iPhone touch事件属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 PhoneGap 应用中的链接上绑定了直播活动。事件成功触发(由 alert() ing确认),但似乎任何触摸数据都没有附加到事件对象上。所有触摸事件都会发生这种情况 - touchstart touchmove touchend

I am binding live events on links in my PhoneGap app. The event does fire successfully (confirmed by alert()ing), but it seems any touch data is not attached to the event object like it should be. This happens on all touch events - touchstart, touchmove, and touchend.

$('a').live('touchend', function(event) {
  event.preventDefault();
  alert(event.touches.length); // event.touches should be populated!
});

任何想法?我是使用jQuery.live()吗?

Any ideas? Am I SOL with jQuery.live()?

推荐答案

活动/直播

来自文档:


可能的事件值:click,
dblclick,mousedown,mouseup,
mousemove,mouseover,mouseout,
keydown, keypress,keyup

Possible event values: click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, keydown, keypress, keyup

目前不支持:模糊,焦点,
mouseenter,mouseleave,更改,提交

Currently not supported: blur, focus, mouseenter, mouseleave, change, submit

您可能需要考虑尝试使用click来满足您的需求,或者您可以切换到使用 livequery ,可能会支持它。 (livequery是live最初的基础,我不确定为什么它不支持所有相同的事件)

You might want to consider trying to use click if that will suit your needs, or you can switch to using livequery, which probably will support it. (livequery is what live was originally based on, I'm not sure why it doesn't support all of the same events)

这篇关于jQuery live()删除iPhone touch事件属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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