JorisD Posted June 11, 2021 Share Posted June 11, 2021 The pen is pretty self-explanatory. I am want to trigger a function when reaching the 2nd section of my page, but for some reason it gets triggered on page load. But on the same ScrollTrigger, the ToggleClass behaves normally. What am I missing here? I am only defining it at first, and then calling it Thanks a lot in advance! See the Pen oNZaoap by jorisd (@jorisd) on CodePen Link to comment Share on other sites More sharing options...
Solution JorisD Posted June 11, 2021 Author Solution Share Posted June 11, 2021 Okay that was stupid. I was not just defining the function but also calling it straight in the JS, before calling it in ScrollTrigger. Now that's embarrassing, please consider I said nothing 🤦♂️ 2 Link to comment Share on other sites More sharing options...
GreenSock Posted June 12, 2021 Share Posted June 12, 2021 No worries, @JorisD. We've all been there, done that Thanks for sharing the solution. 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