anseki / plain-draggable

The simple and high performance library to allow HTML/SVG element to be dragged.
https://anseki.github.io/plain-draggable/
MIT License
765 stars 96 forks source link

Resize #109

Closed David-Carty closed 2 years ago

David-Carty commented 2 years ago

Hey, great functionality. However, I am struggling to maintain containment when I make the div resizable? In short, I need drag, resize and containment functionality. Thanks in advance, David.

anseki commented 2 years ago

Hi @David-Carty, thank you for the comment. You have to call position method if you changed the layout.

David-Carty commented 2 years ago

Hi Anseki, thanks for the quick response. I did notice the position method. Don't know if it will solve my issue. Let me try and explain a little better. In this fiddle:

https://jsfiddle.net/xhLdr03a/1/

I have the resize and containment working, but I also want to drag the blue box whilst still containing it. Is there any way to have the combination of drag, resize and containment? Thanks in advance David

anseki commented 2 years ago

I see. Try this: https://jsfiddle.net/etwyb3sm/

David-Carty commented 2 years ago

Hi Anseki, thanks for that. Looks great. David

anseki commented 2 years ago

:smile: