Jump to content
Search Community

ToggleClass ignoring ToggleActions

jenstarr test
Moderator Tag

Recommended Posts

Hi, I'm trying to adjust a toggleClass where after it toggles on onEnter, it doesn't toggle off until onLeaveBack but you can see the toggle happen for a second on onEnterBack. I've tried adding complete and pause to the onLeave to see if I can get rid of it and nothing seems to work. What is the best way to do this? I appreciate any help, thanks.

See the Pen eYeYKog by jenstarr (@jenstarr) on CodePen

Link to comment
Share on other sites

Hi jenstarr,

 

As noted in the docs, toggleClass is applied when the active/inactive state changes. If you need it to behave differently, you should use the appropriate callbacks for the effect you want.

 

Quote

To have toggle class names in a different way, use the callback functions (onEnter, onLeave, onLeaveBack, and onEnterBack).

 

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