if ($(".swiper-container1").length > 0) {
var lastMoveEvent;
var swiper = new Swiper('.swiper-container1', {
slidesPerView: 8,
loop: true,
freeMode: false,
grabCursor: true,
autoplay: {
delay: 0,
disableOnInteraction: false
},
speed: 3000,
});
swiper.on("touchMove", event => {
if (lastMoveEvent) {
var sliderMovedToLeft = event.clientX - lastMoveEvent.clientX < 0;
var sliderMovedToRight = event.clientX - lastMoveEvent.clientX > 0;
sliderMovedToLeft !== sliderMovedToRight
if (sliderMovedToRight == true) {
swiper.params.autoplay.reverseDirection = true;
} else {
swiper.params.autoplay.reverseDirection = false;
}
}
lastMoveEvent = event;
});
}