Closed DublDesign closed 5 years ago
Hi, firstly you can combine your two calls into one...
$(".customslider").swipe({
swipeLeft:function(event, direction, distance, duration, fingerCount, fingerData) {
goforward(this);
},
swipeRight:function(event, direction, distance, duration, fingerCount, fingerData) {
goback(this);
}
});
Try console logging the value that is passed into your goback handler, if it is you DOM element, then the issue is not with TouchSwipe.
Closing for now, feel free to re open if you are still working on it....
Hi,
first thank you for this plugin, just what I was looking for.
I have a problem with applying the swipe function to two elements with same class. I don't know if it's the plugin or if it's me messing something up again :).
That's the situation: I built a slider with GSAP-GreenSock plugin and jquery. I use buttons to move the slider forwards and backwards. So far everything works fine, now I want to use the same functions to move the slider by swiping. With a single slider it works fine, but as I use two instances of the slider on the same page, only the swipeLeft function works on both instances. The swipeRight function only works on the first instance and not on the second.
here is my code to trigger the swipe:
here are the functions to move the slider:
Here you will find a live version: undercut.lu/test/
Thanks in advance!