ainzon Posted February 10, 2022 Share Posted February 10, 2022 Hi there, I just started to work with GSAP and trying to animate some texts. fade-in / fade-in-left etc. animations are working fine. Now I try to reveal hidden texts when passing the scroll point. So I use ScrollTrigger as well. I think that the major problem here is, that on initialising the code the former position of the following texts is saved so when I scroll to the first one - the other reveal as well. Is there a way to recalculate after the first action is fired? Thanks in advance! Edit: The Codepen here is not working always - but if you open it on codepen it works. I also appreciate any tipps how to optimize the gsap js-code. See the Pen MWOmQVM by boris-andraschko (@boris-andraschko) on CodePen Link to comment Share on other sites More sharing options...
OSUblake Posted February 10, 2022 Share Posted February 10, 2022 Welcome to the forums @ainzon About the only way to make that sure everything is recalculated correctly would be to keep refreshing ScrollTrigger on every update, which could potentially hurt performance. See the Pen RwjVOoX by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Solution ainzon Posted February 11, 2022 Author Solution Share Posted February 11, 2022 @OSUblake - thank you very much for your help. I adjusted my pen a little bit. It works now for me and I hope that I will not run into performance issues... 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