删除多点触控 Web 应用程序中 touchend 事件上的唯一对象
我一直在抓头发,不停地谷歌搜索,但找不到解决方案。通过 touchstart 和 touchmove 事件,我可以从 Touches.identifier 中检索唯一的 ID。这是不可能的,因为触摸不适用于 touchend 事件。
我想创建一个div并在touchstart发生时分配与touches.identifer相同的id。
在 touchmove 事件期间更新 div 中的 xy 字符串。
在touchend事件上使用jqueryremove()删除div。
第3步是我碰壁的地方,我打算使用 $("#"+e.touches.identifier).remove();
有什么建议来实现步骤 3 吗?
非常感谢您的帮助!
Been pulling my hair out and googling non-stop but can't find a solution. With the touchstart and touchmove events, I can retrieve a unique id from touches.identifier. This is not possible as touches does not work with touchend event.
I want to create a div and assign the same id as the touches.identifer when touchstart happens.
Update x y strings in the div during the touchmove event.
Delete the div using jquery remove() on touchend event.
Step 3 is where I'm hitting a wall, i was going to use $("#"+e.touches.identifier).remove();
any suggestions to achieve step 3?
thanks a lot for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何时候是否有多个这样的 div 存在?如果您在 touchstart 上为 div 分配了一个类似“touch”的类,那么您可以在 touchend 上选择 $("div.touch") 。
不过,我自己才刚刚开始接触触摸事件,所以我不确定。
Is there more than one such div present at any time? If you assign the div a class like "touch" on touchstart then you could select $("div.touch") on touchend.
I'm just starting to get into touch-events myself though, so I'm not sure.