'use strict'; const gymSwiper = new Swiper('.gym-swiper', { direction: 'horizontal', breakpoints: { 320:{ slidesPerView: 1.20, spaceBetween: 24, }, 996: { slidesPerView: 3 }, } }); const reviewsSwiper = new Swiper('.reviews-swiper', { spaceBetween: 24, // If we need pagination pagination: { el: '.swiper-pagination', }, // Navigation arrows navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, // And if we need scrollbar scrollbar: { el: '.swiper-scrollbar', }, runCallbacksOnInit: true, // === new change on: { slideChange: function(){ let offer = document.querySelector('#numberReviews'); offer.innerHTML = (this.activeIndex + 1); } } }) // gymSwiper.destroy();