Jump to content
Search Community

scrolltrigger onLeaveBack doesn't fire when i scroll too fast

maipo test
Moderator Tag

Recommended Posts

I have this issue on my website, i fire the scroll to top smootly when i scroll back to the top from the footer of my div, but if I try to scroll too fast, sometimes the go to top smoothly effect doesn't work properly. I use vue.js. I tried to replicate the issue in this code pen, but it seems to be working fine there, instead on my application i have this error that the scroll to top does not work everytime that i fire the onLeaveBack function. Any Idea why? thank you so much.

See the Pen bGQNjOa by maipo89 (@maipo89) on CodePen

Link to comment
Share on other sites

You have overflow hidden on your html/body, but are trying to use window.scrollTo, which is contradictory. Have you looked at using GSAP's scrollTo functionality/plugin? I also see multiple scroll bars in the CodePen, so I'm guessing that's also causing an issue.

For your end value you spelled 'center' incorrectly, and your end value is triggering before your start value the way you have it setup.

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