Jump to content
Search Community

Draggable scroller proxy

Jens De Muynck
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

Jens De Muynck
Posted

First of all, i forked the codepen demo template, but i couldn't get it to work, even though it's exactly the same code as on my local machine. I attached a gif to this post which showcases the following problem:

 

I'm using the Draggable plugin, but noticed an issue when scrolling. The item i was dragging wouldn't scroll down with me. This only seems to happen when the item i'm dragging is in a different scrollable container. Is there a way to set a different scrolling parent on the Draggable instance? I couldn't seem to find anything in the Draggable docs either.

 

TIA,

Jens

demo_small.gif

See the Pen qBwKypm?editors=1111 by JensDeMuynck (@JensDeMuynck) on CodePen.

  • Solution
Posted

Heya! Yeah it seems like unpkg is down at the moment, you can use the jsdelivr links from our install helper instead

https://gsap.com/docs/v3/Installation/?tab=npm&module=esm&method=private+registry&tier=free&club=true&require=false&trial=true

 

Draggable has an autoscroll property, maybe that's what you're after, from the docs it looks like it should work for any scrollable container
https://gsap.com/docs/v3/Plugins/Draggable/autoScroll/

  • 2 weeks later...
Jens De Muynck
Posted

Although this didn't feel intuitive to me in this scenario, autoScroll did fix the issue. Thanks a lot!

  • Like 2

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