Jump to content
Search Community

GSAP Custom Checkbox Issue

james182 test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

  • Solution

Hey @james182

 

You are making one of the most common GSAP mistakes.

You are using a general selector, when instead you would want to loop over each item you want to animate individually.

What you also don't want to do is listen on the document for any change on any input-element, but listen to that specific's element's state instead. Does this make sense?

 

Here is an example of how to do that (with jquery, since you are using it).

 

See the Pen 18c00c3e9545dd1828bbfa5d36902209 by akapowl (@akapowl) on CodePen

 

 

Also, your check for the checked-state of those checkboxes didn't quite seem to work, so just for this example, I set your timeline to reversed and check for the reversed state of the timeline with regard to animating it instead.

 

Hope this helps.

 

Cheers,

Paul

  • Like 4
  • Thanks 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...