Jump to content
Search Community

draggable v3 scrollLeft

j&o test
Moderator Tag

Recommended Posts

Hey ueno and welcome to the GreenSock forums. Thanks for being a Business Green member!

 

As the GSAP 3 release notes say, support for scrollLeft and scrollTop on Draggable have been removed because they can be reproduced without it. We try to keep the code as small as we (reasonably) can!

 

Try just using type: 'x' in your project. Let us know (and potentially create another minimal demo) if you run into issues!

  • Like 1
Link to comment
Share on other sites

hi @ZachSaucier,

 

I am not sure how I can get draggable to update the scroll position anymore. My issue is that I want the user to be able to scroll with a scrollbar, I also update scroll position on a mousewheel event, and would want to be able to update that scroll position via Draggable as well.

 

If i usetype x, then I can transform horizontally well enough, but only with a css transform rather than being able to update scroll position.  Scroll position is subsequently broken if the user opted to scroll or use a mousewheel event.

Is there any way to do this with Draggable and inertia, or should I just look at getting this to work natively (or stick to gsap 2, but I'd much rather update!)

Link to comment
Share on other sites

  • 3 weeks later...

Hey @jim47 and welcome to the GreenSock forums. Sorry for the delay in getting back to you, that doesn't usually happen but we've been busy with GSAP 3 stuff and this turned out to be a little more tricky than we expected.

 

We created a function that you can include to include the scroll draggable behavior in GSAP 3 which you can view here:

See the Pen XWJrYvp by GreenSock (@GreenSock) on CodePen

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