Dodanie reinit swiper scrollbar

This commit is contained in:
2025-12-19 11:16:19 +01:00
parent 5b4582b098
commit 49a399db5d
2 changed files with 82 additions and 75 deletions

View File

@@ -32,6 +32,13 @@ class IdmSwiperProgress {
this.swiper.on("breakpoint", () => {this.updateBarWidth()});
}
reattachSwiperFn(newSwiperFn){
this.swiper = newSwiperFn?.slider?.slider ?? newSwiperFn?.slider ?? newSwiperFn;
this.progressEl.style.width = "";
this.progressEl.style.left = "";
this.updateBarWidth();
}
updateBarWidth() {
const { slidesPerGroup, slidesPerView } = this.swiper.params;
const totalSlides = this.swiper.slides.length;