I have a problem with jQuery swiperight and gesture gestures.
I have two slide shows, the first of which is Bootstrap Carousel, and the second is w3school inspiration.
(codepen)
I found a good solution for Bootstrap somewhere on this page. Here is the code. It works great.
$(document).ready(function() { $(".carousel").swiperight(function() { $(this).carousel('prev'); }); $(".carousel").swipeleft(function() { $(this).carousel('next'); }); });
but if I want this code to include and modify the code from w3school , this will not work. So I tried something like this (it wonβt work in codefen, I donβt know why ..)
$(function(){ $( ".news-slide-content-img" ).on( "swipeleft", swipeleftHandler ); $( ".news-slide-content-img" ).on( "swiperight", swiperightHandler ); function swipeleftHandler( ){ plusSlides(1).css('display', 'block'); } function swiperightHandler( ){ plusSlides(-1).css('display', 'none'); } });
If I spent it, he spent more images than one.
Any ideas how to solve this gesture problem?
Here is the codepen
source share