Jump to content
Search Community

ScrollTrigger.scrollerProxy() not working – Smooth ScrollBar

Shaban Iddrisu™ test
Moderator Tag

Recommended Posts

Greetings All!

 

I am having a little problem testing out Smooth-ScrollBar with ScrollTrigger. Without any ScrollTrigger based animation, the smooth-scrollbar works as it should. However, with ScrollTrigger implement, the animation does not play.  I have added the scrollerProxy() to my code but to no avail. Perhaps I am missing a key snippet my code. 

Kindly take a look and help me figure this out.

Thank you!

See the Pen jOMLWay by shaban-iddrisu (@shaban-iddrisu) on CodePen

Link to comment
Share on other sites

Hey @Shaban Iddrisu™

 

It doesn't work, because you are creating the ScrollTrigger before you even initialized the smooth-scrollbar and set up the scrollerProxy, so the ScrollTrigger can't know anything about smooth-scrollbar.

 

The order should be this:

1) Initialize smooth-scrollbar

2) Hook up the scrollerProxy

3) Create your ScrollTriggers

 

See the Pen 15e6b6107b39a39d2e71d7e7eff61eb5 by akapowl (@akapowl) on CodePen

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