Hi Siton, thanks for sharing how to implement swiper.js, it works great.
I have an issue however that I am hoping you are able to help me with I have implement swiper inside a collections list which means it is being duplicated many times. Is there away to get this working?
I did come across the js but I realise this won’t work because you can’t change the name of each instance individually within the same collection list.
const myCustomSlider = document.querySelectorAll(‘.swiper-container’);
for( i=0; i< myCustomSlider.length; i++ ) {
myCustomSlider[i].classList.add(‘swiper-container-’ + i);
var slider = new Swiper(‘.swiper-container-’ + i, {
/* Options */
});
}
I have attached a screen shot of where it is located.