Javascript code for custom icon to move slide on element or image slider

Right now I have an Elementor Image Carousel slider, which I’ve customized to my liking. I’ve added custom icons with custom placement, which should make the slide move back and forth on icon click. I know Elementor uses swipers, but I’m still struggling to get the icons to move. I’m starting the swiper instance, but somehow can’t get the icons to move the slides back and forth.

var sliderInstance = document.querySelector('#image-car .swiper-container').swiper;

$('#arr-next').on('click', function() {
sliderInstance.slideTo(2)
});

Any ideas, how to select the icons and move the slider to them?

Leave a Comment