1,轮播图在到达最后一张后返回第一张
let i = 0;
setInterval(() => {
// tslint:disable-next-line:max-line-length
this.rd2.setProperty(this.imgSlider?.nativeElement,
'scrollLeft',
(++i % this.sliders.length * this.imgSlider?.nativeElement.scrollWidth) / this.sliders.length);
}, this.intervalBySeconds * 1000);
网友评论