Skip to content

Commit

Permalink
fix(module:carousel): fix if carousel Out of sight stop carousel play. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Guoyuanqiang committed Apr 12, 2019
1 parent bcd5d1f commit 362245f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/carousel/carousel.component.ts
Expand Up @@ -218,6 +218,9 @@ export class CarouselComponent implements AfterViewInit, OnDestroy {
this.stopTimer();
this._timer = this.autoplayInterval
? setInterval(() => {
if (document.getElementsByTagName('carousel').length === 0) {
return;
}
this.carousel(1);
}, this.autoplayInterval)
: 0;
Expand Down

0 comments on commit 362245f

Please sign in to comment.