отключить autoplay - скролл до 1-го слайда - включить autoplay
navList[i].addEventListener("click", (evt) => {
let currentLink = tabContainer.querySelector(
".slidersTab__tab-label.current"
);
let currentTab = tabContainer.querySelector(
".slidersTab__slidersItem.current"
);
//добавить 4 строчки -- start
let currentSlider = tabList[i].querySelector('.slidersTab__slider-body').swiper;
currentSlider.autoplay.stop();
currentSlider.slideTo(0, 0, false);
currentSlider.autoplay.start();
//-- end
currentLink.classList.remove("current");
navList[i].classList.add("current");
currentTab.classList.remove("current");
tabList[i].classList.add("current");
});
const mySwiper = new Swiper('.slider-3steps', {
scrollbar: {
el: document.getElementById('swiperScrollbar') //где swiperScrollbar - id скорллбара соответственно
},
});
let containers = document.getElementsByClassName('promo-group__swiper-container');
Array.from(containers).forEach(function(element) {
var swiper = new Swiper(element, {
navigation: {
nextEl: element.querySelector('.swiper-button-next'),
prevEl: element.querySelector('.swiper-button-prev')
}
});
});
var sliders = document.querySelectorAll('.swiper'),
prevArrow = document.querySelectorAll('.swiper-btn-prev'),
nextArrow = document.querySelectorAll('.swiper-btn-next');
sliders.forEach((slider, idx) => {
let swiper = new Swiper(slider, {
slidesPerView: 6,
spaceBetween: 10,
navigation: {
nextEl: nextArrow[idx],
prevEl: prevArrow[idx],
},
breakpoints: {
320: {
slidesPerView: 2,
spaceBetween: 10
},
480: {
slidesPerView: 3,
spaceBetween: 10
},
970: {
slidesPerView: 6,
spaceBetween: 10
}
}
})
})
<div class="slider-wrapper">
<div class="swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
</div>
</div>
<!-- Кнопки -->
<div class="myslider-prev swiper-button-prev"></div>
<div class="myslider-next swiper-button-next"></div>
</div>
var swiper = new Swiper('.swiper', {
...тут ваши прочие параметры
navigation: {
nextEl: '.myslider-next',
prevEl: '.myslider-prev',
},
});
pagination: {
el: '.swiper-pagination',
dynamicBullets: true, //включаем поддержку динамических буллетов
dynamicMainBullets: 7, //максимальное количество отображаемых буллетов
},