lueenavarro
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by lueenavarro
-
-
animateBanner() { let counter = 0; const intervalTime = 3000; const tlm = new TimelineMax({ paused: true }); setInterval(() => { if (counter === this.bannerPhotos.length) { tlm.to(this.banner.nativeElement, 0, { x: '-100vw' }); counter = 0; } tlm.to(this.banner.nativeElement, 1, { x: '-=100vw', ease: Sine.easeOut }); tlm.play(); counter++; }, intervalTime); }
I am creating an infinite loop carousel with GSAP, I'm having issues with setInterval where the animation goes really fast when I switch to other tabs then I go back. How can I refactor the code above using the GSAP way.
Refactor code to work with GSAP
in GSAP
Posted
I am animating only the container of the photos, not the photos themselves. So I cannot use stagger. I was able to do it like this:
Thanks for the help!