I'm using swiper.js library and want to change the behaviour on a slider. The default effect is "slide", which means an image slides from right to left. However, I would like to disable this behaviour in a callback function I wrote after the initialization of my slider. Is there any way I can approach this so that the inactive slide fades out and the active on slides in?
let swiper = new Swiper(element, settings);
swiper.on('slideChangeTransitionStart', () => {
$('.swiper-slide').each(function () {
if ($(this).index() === swiper.activeIndex) {
// Slide in active slide, enable slide behaviour
console.log('slide in');
} else {
// Fadeout inactive slide, enable fade effect
console.log('fade out');
}
});
})