TouchSwipe -一次滑动多个事件

TouchSwipe - multiple events on one swipe

本文关键字:事件 一次 TouchSwipe      更新时间:2023-09-26

我使用TouchSwipe jQuery插件为我的网站的移动版本。我需要在一次滑动上触发多个点击事件,比如-在每15px的滑动上-一次点击。我用谷歌搜索过了,但没有找到答案。

事情是-我使用carousel插件的Joomla (sigplus),那,不幸的是,不支持手指滑动。我试图通过让TouchSwipe按下旋转按钮来模拟滑动功能。现在我有这样的代码:

 jQuery(function($) {
$(".s2").swipe({
    excludedElements: "button, input, select, textarea, .noSwipe",
  swipeLeft:function(event, direction, distance, duration, fingerCount) {
     $( '.boxplus-next' ).click();
  }, 
  swipeRight:function(event, direction, distance, duration, fingerCount) {
     $('.boxplus-prev').click();
  },
  triggerOnTouchEnd:false,
  threshold:15
});
});

它工作得很好,但是每次触摸只能在旋转木马中滚动一个图像。也许触发后可以重新启动功能?

感谢

注:对不起,我的英语

要触发连续事件,您应该使用swipeStatus事件:http://labs.rampinteractive.co.uk/touchSwipe/demos/Swipe_status.html

你可以根据距离触发next或back。

使用TouchSwipe
在一个元素上设置多个滑动事件