Jump to content
Search Community

Draggable dont set correctly the container witdth

phil21 test
Moderator Tag

Recommended Posts

Hi @phil21 and welcome to the GreenSock forums!


Thanks for the simple example, that made it super easy! 🥳


The main issue in this cases is to get the start position and width of the element and since the side handles are inside the containers keeping them in place is super easy. I made this example in codepen since I didn't had time to go through the whole React setup, but porting it to React shouldn't be too complicated. Also this considers the left handle but setting up the right one should follow a similar logic:

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


Sorry I wasn't able to come up with a full solution, but hopefully this is enough to get you on the right handle-track :D.

Let us know if you have more questions.

Happy Tweening!

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