Tony Geek Posted November 14, 2023 Share Posted November 14, 2023 Hi, I'm new to the GSAP Draggable Plugin. I'm attempting to create a simple horizontal draggable element to act like a games library. However, I can't seem to get the draggable container to correctly use the boundaries of the container. I've gotten this as close as I can to functioning in terms of keeping the dragged position, as that seems to have been glitching majorly for me. I've spun that up onto a codepen so you can see what I mean. I just want to know how I can have a horizontal draggable container that: Respects the boundaries set by it's container. Maintains it's position after the drag is let go. Help much appreciated in advance! See the Pen gOqGpar by tonycre8-the-bold (@tonycre8-the-bold) on CodePen Link to comment Share on other sites More sharing options...
Solution Rodrigo Posted November 14, 2023 Solution Share Posted November 14, 2023 Hi, I think this is a better approach IMHO: See the Pen xxMXRwm by GreenSock (@GreenSock) on CodePen Also the configuration now is inertia: true, not throwprops: https://gsap.com/docs/v3/Plugins/Draggable/#config-object Hopefully this helps. Happy Tweening! 1 Link to comment Share on other sites More sharing options...
Tony Geek Posted November 15, 2023 Author Share Posted November 15, 2023 12 hours ago, Rodrigo said: Hi, I think this is a better approach IMHO: Also the configuration now is inertia: true, not throwprops: https://gsap.com/docs/v3/Plugins/Draggable/#config-object Hopefully this helps. Happy Tweening! Yeah, that looks like the solution to me. Thanks a lot for the help! Link to comment Share on other sites More sharing options...
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