Jump to content
Search Community

timelines in timeline

benoit test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Oh, alright - I think the confusion is that you're creating a new timeline every time you call your timeline creation function -  tlsub('.a') or tlsub('.b')
 

So when you call seek again, you're not calling seek on the first timeline, you're making a new timeline with a new animation on the same element and calling seek on that second timeline.

I can't really advise on a better route because I'm not sure of the end goal. But that's what's happening.

  • Like 1
Link to comment
Share on other sites

  • Solution

I glanced at your code too and I'm very confused about what you're trying to do. If you can explain your goal, perhaps we can offer advice on a better way to accomplish it. 

 

You seem to be misunderstanding how things are supposed to work or the logic flow. Let's consider just these two lines: 

tl.call(e=>tlsub('.a').seek(5,false),null,1); // go to 5s -> 250px is OK
tl.call(e=>tlsub('.a').seek(2,false),null,2); // go to 2s -> 100px is not OK

When the timeline reaches 1 second, it calls that first line which creates a whole new paused timeline animating the element's x from wherever it is currently (0) to 500 over the course of 10 seconds, so since you seek(5), that means it's halfway to 10, thus x is 250. Great. Then the next line creates a whole new paused timeline animating the element's x from wherever it is currently (250) to 500 over the course of 10 seconds. Since you then seek(2), that's 20% of the way from 250 to 500 which is 300. 

 

Everything is working exactly the way you've asked it to. 

 

But again, I don't really understand why you're doing all this so it's hard for me to offer advice. 

  • Like 1
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.
×
×
  • Create New...