Swipeleft, swiperight events triggered multiple times


First of all, this is a great script. But I'm trying to understand why are the swipeleft, swipeleftup, swipeleftdown, swiperight, swiperightup and swiperightdown events triggered multiple times after the touch/gesture
has completed. In my experience, they're triggered at least three times for every event.

file attachments

Closed Jun 12, 2012 at 4:38 PM by neuedigitale


Gargol wrote May 23, 2012 at 2:36 PM

have the same issue. really liked the library but this made me stop using it. wish you luck in further development.

wrote May 25, 2012 at 3:07 PM

wrote Jun 3, 2012 at 12:27 AM

travisstevens81 wrote Jun 3, 2012 at 12:27 AM

If you look at the _onTouchend function, you'll notice that each bound event is put through a loop and switch statement. Unfortunately, the script doesn't detect the matching event (it fires off all bound events under the corresponding switch statement cases), so I've added a simple check to the trigger handler that fires off your callback function only if it matches the event that occurred. For others experiencing problems with similar bound events firing multiple times, this same logic can be applied.

//if the swipe matches the current bound swipe type in the loop, trigger the callback
if (_sType == _oDetails.type) {
_$element.triggerHandler(_oDetails.type, _oDetails);

wrote Jun 12, 2012 at 4:38 PM

wrote Feb 22, 2013 at 1:36 AM

wrote May 16, 2013 at 12:37 PM