js 移动端判断手机的点击次数和滑动执行事件
document.addEventListener('touchstart', touch, false); document.addEventListener('touchmove', touch, false); document.addEventListener('touchend', touch, false); var tn = 0; function touch(event) { var event = event || window.event; switch (event.type) { case "touchstart": break; case "touchend": tn++; if (tn >= 2) { //大于点击次数 } break; case "touchmove": // 执行滑动事件 break; } }