Jens De Muynck Posted April 12, 2024 Posted April 12, 2024 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 See the Pen qBwKypm?editors=1111 by JensDeMuynck (@JensDeMuynck) on CodePen.
Solution Cassie Posted April 12, 2024 Solution Posted April 12, 2024 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/
Jens De Muynck Posted April 22, 2024 Author Posted April 22, 2024 Although this didn't feel intuitive to me in this scenario, autoScroll did fix the issue. Thanks a lot! 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now