我想在用户向下滚动移动设备页面时禁用touchstart事件.该页面具有各种元素,当您单击切换一个类但我希望当用户向下滑动以向下滚动页面时,将触摸touchstart事件.
JQUERY
$(document).on('touchstart click', '.flip-container ', function(event){ event.preventDefault(); $(this).find('.flipper').toggleClass('hover'); });
任何人都知道如何?谢谢!
var touchmoved; $('button').on('touchend', function(e){ if(touchmoved != true){ // you're on button click action } }).on('touchmove', function(e){ touchmoved = true; }).on('touchstart', function(){ touchmoved = false; });
/sf/ask/17360801/