Commit 726373b5 by abraham

slidechange

parent 04e55605
......@@ -27,8 +27,10 @@ export class CarouselComponent implements AfterViewInit {
next() {
if (this.currentSlide + 1 === this.items.length) return;
console.log(this.items);
console.log(this.itemWidth);
this.currentSlide = (this.currentSlide + 1) % this.items.length;
const offset = this.currentSlide * this.itemWidth;
const offset = this.currentSlide * 404;
const myAnimation: AnimationFactory = this.buildAnimation(offset);
this.player = myAnimation.create(this.carousel.nativeElement);
this.player.play();
......
<section class="carousel-wrapper" [ngStyle]="carouselWrapperStyle">
<ul class="carousel-inner" #carousel>
<li *ngFor="let item of items;" class="carousel-item">
<li *ngFor="let item of items;" class="carousel-item" >
<ng-container [ngTemplateOutlet]="item.tpl"></ng-container>
</li>
</ul>
......
......@@ -8,3 +8,11 @@
}
}
}
.carousel-inner {
display: flex;
width: max-content;
.carousel-item{
width: 404px !important;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment