aneritac Posted July 30, 2020 Share Posted July 30, 2020 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. 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 More sharing options...
GreenSock Posted July 30, 2020 Share Posted July 30, 2020 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? 2 1 Link to comment Share on other sites More sharing options...
aneritac Posted July 30, 2020 Author Share Posted July 30, 2020 Yes it does! Thank you! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now