Jump to content
Search Community

Reverse animation on Leave

aneritac test
Moderator Tag

Recommended Posts

Hi guys,

 

I'm kind of confused about toggleActions at this moment. In my case it doesn't seem to work.

What I'm trying to achieve is moving my containers by a certain number of pixels when enter the scroller-window and then moving back to its initial position when the container has left said scroller-window.  But you can see from my demo that when scrolling the previous element is not reset to its initial position.1561167628_Screenshot2020-07-30at10_57_19AM.thumb.png.eb4fd601a901cd4c12819fcace92f81a.png

What am I doing wrong?

 

Thank you for your help and thank you for this amazing tool!!!

See the Pen pogXwRM by katy_datt (@katy_datt) on CodePen

Link to comment
Share on other sites

I think the key misunderstanding is that you can EITHER have toggleActions OR scrub, not both. Logically it wouldn't make much sense to have both because if you've got scrub enabled, that wires the progress of the animation directly to the scrollbar; toggleActions are for when you want a specific playback-related control to be exerted on the animation at the various toggle points (onEnter, onLeave, etc.) That couldn't happen if it's wired directly to the scrollbar. In other words, only one could exert control on the animation. Either the scrollbar will scrub the playhead or a playback method will be called at toggle points. 

 

Does that clear things up? 

  • Like 2
  • 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...