嗨,我用触地移动事件,
这段代码不适合我,
$(".tempClass").on("touchmove",function(){
alert("touchmove on div");
});这个代码是为我工作的,
$(document).on("touchmove",function(){
alert("touchmove on document");
});我担心为什么我不能收听div元素上的touchmove
我正在使用PhoneGap3.0,Android4.0.4。
我正在测试的设备是三星星系标签10.1。
发布于 2013-10-01 07:36:59
通常,当我们不知道DOM中什么时候存在一个元素时,就会使用事件委托。它依赖于不断膨胀的DOM事件,直到它们到达根选择(在您的例子中,它总是文档元素)。
$(document).on('touchmove', '.tempClass', function () {
// ...
});https://stackoverflow.com/questions/19109300
复制相似问题