trych Posted August 20, 2021 Share Posted August 20, 2021 Hi there! I have created a timeline that I control via a ScrollTrigger. When I load the page I am right at the beginning of that scroll animation (as in, as soon as I start to scroll, the timeline starts). The ScrollTrigger's onEnter event fires right on page load, but the onStart event does not fire at all, even when I start scrolling. Is this the expected behavior? If so, what is a good way to fire a single event once the scrolling animation has started? Thanks! trych Link to comment Share on other sites More sharing options...
Solution trych Posted August 20, 2021 Author Solution Share Posted August 20, 2021 Ok, seems I can answer my own question. When I use the doc's onUpdate example in this setup, I get back something like this on page load: 5.11247182388966e-7 1 true. So it seems like after page load the ScrollTrigger animation has already started ever so slightly. I fixed my issue now, by giving the ScrollTrigger a starting value of 1 pixel, then it will fire the onStart callback correctly. 1 Link to comment Share on other sites More sharing options...
Cassie Posted August 20, 2021 Share Posted August 20, 2021 Well this was a simple forum post - Thanks for solving your own question @trych 4 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