pull/1/head
Jan Umbach 2024-05-29 21:05:37 +02:00
parent 2774455337
commit eecb304db7
1 changed files with 3 additions and 1 deletions

View File

@ -616,7 +616,7 @@ class SliderComponent extends HTMLElement {
super();
this.slider = this.querySelector('[id^="Slider-"]');
this.sliderItems = this.querySelectorAll('[id^="Slide-"]');
this.enableSliderLooping = true;
this.enableSliderLooping = false;
this.currentPageElement = this.querySelector('.slider-counter--current');
this.pageTotalElement = this.querySelector('.slider-counter--total');
this.prevButton = this.querySelector('button[name="previous"]');
@ -657,6 +657,8 @@ class SliderComponent extends HTMLElement {
const previousPage = this.currentPage;
this.currentPage = Math.round(this.slider.scrollLeft / this.sliderItemOffset) + 1;
console.log('currentPage', this.currentPage, 'totalPages', this.totalPages, 'previousPage', previousPage);
if (this.currentPageElement && this.pageTotalElement) {
this.currentPageElement.textContent = this.currentPage;
this.pageTotalElement.textContent = this.totalPages;