Jump to content
Search Community

onStart does not fire on scrollTrigger animation

trych test
Moderator Tag

Go to solution Solved by trych,

Recommended Posts

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

  • Solution

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.

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