Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Saqib110

scrollto top

Recommended Posts

image.png.196e1c4dd3f0f6e8978be5058edb7fe5.png

image.png.383774bcc10dde4f89f939e1dca6c552.png

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

image.png.0b68b7a6e51c2fd94d09ee9e9ab6a552.png

Any solutions?

 

Link to comment
Share on other sites

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.
×