swiper.on('slideChange', ({ activeIndex }) => {
document.querySelectorAll('.points .point').forEach((n, i) => {
n.classList.toggle('active', i === activeIndex);
});
})
document.querySelector('.points').addEventListener('click', ({ target: t }) => {
if (t.classList.contains('point')) {
swiper.slideTo([...t.parentNode.children].indexOf(t));
}
});
pagination: {
el: '.points',
bulletClass: 'point',
bulletActiveClass: 'active',
renderBullet: (index, className) => `<div class="${className}">${index + 1}</div>`,
clickable: true,
},