Jump to content
Search Community

scrollto top

Saqib110 test
Moderator Tag

Recommended Posts

11 minutes ago, Saqib110 said:

i am using scroll trigger plugin for smooth scrolling but i am getting this error

 

It looks, like you are actually not using ScrollTrigger for the smooth-scrolling, but rather smooth-scrollbar.js, which is a third party plugin. Due to the way it works, you won't be able to use GSAP's ScrollTo Plugin with it.

 

Smooth-Scrollbar does have a ScrollTo method of its own, which you can find more info on in their API documentation

 

https://github.com/idiotWu/smooth-scrollbar/blob/2ee583ea0c927c702194e4704ba80feee57942c7/docs/api.md#scrollbarscrollto

 

 

You can find an example usecase of it in this thread here e.g.

 

 

 

 

If you do want to use a ScrollTrigger-native approach for the smooth-scrolling, there is an example of a helper function for that on the .scrollerProxy() documentation page - it should work just fine with the ScrollTo-Plugin, too (which you can see in the demo below, when you click anywhere - I attached a click event to the body there). I hope that'll help - happy scrolling!

 

See the Pen PoJMrxp by akapowl (@akapowl) on CodePen

 

 

 

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