【发布时间】:2012-11-21 07:02:40
【问题描述】:
如何在touchmove过程中获取手指下元素的id?
我想要实现的是:
- 绑定触摸[开始|结束|移动]
- 在 touchstart 开始选择时
- 在 touchmove 期间收集我手指下“触摸”的所有 dom 元素
示例代码
var collected = [];
$('body').bind('touchstart touchmove touchend', function(event) {
event.preventDefault();
if(event.type == 'touchstart') {
collected = [];
} else if(event.type == 'touchmove') {
// id of the element under my finger??
// insert in collected the id of the element
} else if(event.type == 'touchend') {
// some code
}
});
解决了。
【问题讨论】:
-
@Daneb:你最后是怎么解决的,能发一下你的解决方案吗?
标签: jquery google-chrome touchmove