I have a problem with jquery swiperight and swipeleft gestures.
I have two slideshows, first one is Bootstrap Carousel and second one is inspiration from w3school.
I found good solution for Bootstrap somewhere on this page. Here is the code. It works perfect.
$(document).ready(function() {
$(".carousel").swiperight(function() {
$(this).carousel('prev');
});
$(".carousel").swipeleft(function() {
$(this).carousel('next');
});
});
but if I want this code include and modificate to code from w3school it won't work. So I tried something like this (It won't work in codepen 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 swipe it it swipe more images than one.
Any ideas how to solve this gesture problem?
Here is codepen