Codetipi Posted July 16, 2020 Share Posted July 16, 2020 If you have a ScrollTrigger with an onEnter() method, it only runs if you literally scroll past the Start marker - which is expected. But if you scroll to the end of a page and refresh the page, the onEnter event isn't triggered. If you take the Lazy Load example in the codepen (although it isn't really possible to test what I'm saying there), then refreshing at the end of the page would mean the images' lazy load method would never trigger. It would only happen if the user scrolled up past the start marker and then back down to trigger the onEnter method. Is there an event similar onEnter() that would trigger if marker is "on Enter or if already past"? I can see trying to use ScrollTrigger for injecting content via infinite scrolling for example being problematic without something like this. See the Pen YzydvBE by GreenSock (@GreenSock) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted July 16, 2020 Share Posted July 16, 2020 Hey Codetipi. This should be the default behavior as of version 3.3.4. What version of ScrollTrigger are you using? If you don't want this to happen, you can set limitCallbacks: true in ScrollTrigger's .config(). 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