Jump to content
GreenSock

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

Adding a class to an object at a specific point in a timeline

Go to solution Solved by Shaun Gorneau,

Recommended Posts

Hi, I'm trying to have an object spin endlessly at the end of a timeline. Right now it's just a 360 rotation - I figured that it'd be best to add a class with a css animation at this point in the timeline, but I can't seem to get it to work. The only reference I found in the docs was className: '+=active', but it doesn't seem to be doing anything. 

 

Thanks in advance!

See the Pen QWpKoPJ by marekmarek (@marekmarek) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @ZORGOBORGO

 

You can accomplish this with GSAP alone (which I would recommend) by pulling that tween out of the timeline and making a call to a separate tween at that point of the timeline (with a conditional check to see if it's already been called).

 

See the Pen wvJovBd?editors=0010 by sgorneau (@sgorneau) on CodePen

  • Like 3
Link to comment
Share on other sites

Thanks for this. Works flawlessly.

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