Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
DexteRs Code

gsap ScrollToPlugin not working with ScrollTrigger.scrollerProxy()

Go to solution Solved by akapowl,

Recommended Posts

I'm creating a project where i need smooth scrolling as well as scroll-to function. In my codepen I've used smooth-scrollbar library coexisting with scrolltrigger's scrollerproxy() library... which works fine. But due to the scrolljaking the scrolltoplugin is not working properly. I've tried scrolltoplugin without smooth scrolling it works but I need both to work together. Is there any way to make them work together?

 

Thanks in advance!

See the Pen qBXWYWq by dexterscode (@dexterscode) on CodePen

Link to comment
Share on other sites

  • Solution

Hello @DexteRs Code

 

GSAP's ScrollTo-Plugin won't work with smooth-scrollbar.js because of how smooth-scrollbar makes the smooth-scrolling work - it basically changes everything. That is why smooth-scrollbar has a scrollTo()-method of its own that you will have to use instead.

 

Here is a link to their API documentation:

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

 

Happy smooth-scrolling :) 

 

 

  • Like 1
Link to comment
Share on other sites

Ohh no, I didn't knew that 😅.

Thanks for replying this quick.🙏

  • Like 1
Link to comment
Share on other sites

hey it worked, I didn't used scrollTo() method cause it takes value as position... I used scrollIntoView() which takes html element as target.

thanks again.. 

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