Jump to content
Search Community

Calendar with 12 different timelines/steps. Not sure which way is correct.

dbj test
Moderator Tag

Go to solution Solved by Diaco,

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

Hello, I've been trying to make this calendar pen that has a different timeline for each month, and the user can click through the months and see the different animations.

 

At first I tried creating a separate timeline for each month, and calling it from the master timeline, but then I was having problems with tweening between two timelines and being able to reverse.

 

So I found out that I should rather be using one timeline with 12 markers, and using tweenFromTo to switch between them.

 

As you can see from my demo I'm not there yet... but I might be pretty close. I know it has to do with me being terrible at "clever" JavaScript but I'm a designer-trying-to-code kinda guy, so be gentle!

 

Am I close with my code, or is there a much better way that I'm not figuring out?

 

Thanks,

David

See the Pen right by dbj (@dbj) on CodePen

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...