Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
immarcelo

Repetition inside timeline: is it possible?

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hey there,

I'm just getting started with GSAP and so far loving it! But there's one thing I couldn't get figure yet and I can't find any example online: tween repetition inside a timeline without stuck it

 

I mean:

var timelineChain1 = new TimelineMax();
		timelineChain1.to("#timeline-1 .el", .2, {autoAlpha:1}) /*STEP 1*/
		.to("#timeline-1 .el", .2, {scale:.8, repeat:-1, yoyo:true}) /*STEP 2*/
		.staggerTo("#timeline-1 .el", .2, {x:-20}, .2 ); /*STEP 3*/

What happens: step 1 runs ok, then the timeline get stuck in the repeatition of step 2, so step 3 never happens.

What I want: the infinity repetition to continue as the timeline goes on. Is it possible? 

 

Thanks and keep going!

Link to comment
Share on other sites

Hi immarcelo :)

 

Welcome to the GreenSock forum.

 

There would be a few ways to make that happen. You could put the repeating timeline into a function and call it when you need it. You could set a hard coded start time for the tweens. You could also use recent() and endTime(). All those solutions were discussed in a similar thread here:

 

https://greensock.com/forums/topic/13717-infinitly-repeating-tween-stops-timeline/

 

I'm confident one of those solutions will work well for you.

 

Happy tweening.

:)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×