Skip to content

Commit

Permalink
close #4 Build features to use component in web-component-designer ->…
Browse files Browse the repository at this point in the history
… intervall default to 0
  • Loading branch information
cedricfranke28 committed Jan 24, 2024
1 parent 007b367 commit ba64b1a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/slider/AutomaticSliderShowWebcomponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class AutomaticSliderShowWebcomponent extends BaseCustomWebComponentConst

private _dots: HTMLDivElement;
private _slideIndex = 0;
private _interval: number = 2000;
private _interval: number = 0;
private _timeoutId: any;
private _observer: MutationObserver;

Expand Down Expand Up @@ -166,8 +166,10 @@ export class AutomaticSliderShowWebcomponent extends BaseCustomWebComponentConst

this._slideIndex++;
// console.log(this._slideIndex);
clearTimeout(this._timeoutId);
this._timeoutId = setTimeout(() => this._showSlides(), this._interval);
if (this._interval != 0) {
clearTimeout(this._timeoutId);
this._timeoutId = setTimeout(() => this._showSlides(), this._interval);
}
}

prevSlide() {
Expand Down

0 comments on commit ba64b1a

Please sign in to comment.