James135 Posted August 3, 2022 Share Posted August 3, 2022 Take a look at this Pen's JS, the onComplete function should be getting triggered, but it isn't. However, the onUpdate is being triggered. What could be causing this? See the Pen xxWYQVM by StevenShmeven (@StevenShmeven) on CodePen Link to comment Share on other sites More sharing options...
Solution James135 Posted August 3, 2022 Author Solution Share Posted August 3, 2022 Workaround: ScrollTrigger.addEventListener("scrollEnd", () => { console.log('done') }); I updated the Pen 1 Link to comment Share on other sites More sharing options...
GreenSock Posted August 3, 2022 Share Posted August 3, 2022 3 hours ago, James135 said: Take a look at this Pen's JS, the onComplete function should be getting triggered, but it isn't. However, the onUpdate is being triggered. Seems to be working perfectly - that tween animates everything all the way to the left, and you've got scrub: true, so the scrollbar basically moves the playhead on the tween, thus it wouldn't fire the onComplete until you scroll ALL the way down. See what I mean? Were you expecting it to fire every time you stopped scrolling? Sounds like you found the solution with the scrollEnd event. 👍 Link to comment Share on other sites More sharing options...
James135 Posted August 3, 2022 Author Share Posted August 3, 2022 Yeah, GSAP is elegantly coded 14 hours ago, GreenSock said: Seems to be working perfectly - that tween animates everything all the way to the left, and you've got scrub: true, so the scrollbar basically moves the playhead on the tween, thus it wouldn't fire the onComplete until you scroll ALL the way down. See what I mean? Were you expecting it to fire every time you stopped scrolling? Sounds like you found the solution with the scrollEnd event. 👍 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