diff --git a/src/plugins/carousel/index.ts b/src/plugins/carousel/index.ts index 0b5b00b..4904a68 100644 --- a/src/plugins/carousel/index.ts +++ b/src/plugins/carousel/index.ts @@ -894,6 +894,8 @@ class HSCarousel extends HSBasePlugin implements ICarousel { this.currentIndex = this.slides.length - this.getCurrentSlidesQty(); } + this.fireEvent('update', this.currentIndex); + if (this.isSnap) { const itemWidth = this.sliderWidth / this.getCurrentSlidesQty(); @@ -922,6 +924,8 @@ class HSCarousel extends HSBasePlugin implements ICarousel { this.currentIndex = 0; } + this.fireEvent('update', this.currentIndex); + if (this.isSnap) { const itemWidth = this.sliderWidth / this.getCurrentSlidesQty(); const maxScrollLeft = this.container.scrollWidth - @@ -943,6 +947,8 @@ class HSCarousel extends HSBasePlugin implements ICarousel { const currentIndex = this.currentIndex; this.currentIndex = i; + this.fireEvent('update', this.currentIndex); + if (this.isSnap) { const itemWidth = this.sliderWidth / this.getCurrentSlidesQty(); const index = currentIndex > this.currentIndex