滑动不触发触碰事件

var moved = false;

$(dom).bind("touchend", function(touchEndFn) {
    if (!moved) {
        // 点击事件
    }
    moved = false;
});

$(dom).bind("touchmove", function() {
    moved = true;
    console.log("moving");
});

猜你喜欢

转载自my.oschina.net/u/2371743/blog/918457