Apologies in advance - this is such a fundamental question: Why are swipeleft and swiperight not working?
(function() {
$('img').on('swiperight', swipeRight);
function swipeRight(myEvent){
myEvent.stopPropagation();
alert('swipeRight');
};
$('img').on('swipeleft', swipeLeft);
function swipeLeft(myEvent) {
myEvent.stopPropagation();
alert('swipeLeft');
};
})();
I've loaded jQuery, but do I need to load a entire library like jQuery Mobile or Angular? I just want to slide from 1 picture to the next.
Standard jQuery doesn't define a swiperight or swipeleft event. jQuery Mobile does, however. You'll have to load that library to utilize those event handlers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With