Jump to content
Search Community

Reseizing a draggable

MR FIX IT test
Moderator Tag

Recommended Posts

Hello ,

while making the resize functionality on a draggable I kept having some issues

1- which is re-placing the resize handles after either release or dragEnd 

in some cases the handle stays in the middle while in others the handle goes to the other side knowing that I kept re-placing after each event  

2- while using the left handle the bounds aren't applied thus having the ability to infinitely resize from the left  

please note the repositioning of the "mainDiv"  is a bug from moving the code to codepen and its not present in the my code 

 

thank you  so much in advance ..

 

See the Pen PoREjQJ by mazthenew (@mazthenew) on CodePen

Link to comment
Share on other sites

Hi @MR FIX IT. Thanks for being a Club GreenSock member! 💚

 

The problem is definitely related to all your custom code there which is beyond the scope of help we can generally provide in these forums. We're happy to answer any GSAP/Draggable-specific questions but consulting for the custom logic would take a lot more time for us to wrap our heads around and troubleshoot for you. From a cursory glance, it looked very inefficient to me. I suspect there's a cleaner/simpler solution that'd accomplish what you're looking for. I just don't have time to rewrite it all for you. 

 

Perhaps this thread could help: 

 

Or this one: 

 

If you still need help with the custom logic, you're welcome to post in the "Jobs & Freelance" forum or contact us directly if you'd like to hire GreenSock. 

 

Good luck!

  • Like 1
Link to comment
Share on other sites

Thank you Jack ,

even when using the second post's logic (I added the recommended  fix ) there is a problem when reducing the width from the left the outer div is dragged even with disabling any drag events  and  stopping  events  propagation

 

Link to comment
Share on other sites

7 hours ago, MR FIX IT said:

even when using the second post's logic (I added the recommended  fix ) there is a problem when reducing the width from the left the outer div is dragged even with disabling any drag events  and  stopping  events  propagation

If you still need help with a GSAP/Draggable-specific question, please provide a minimal demo that isolates only that issue and we'd be glad to take a look. 

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