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
773 stars 99 forks source link

how to set a wall that draggable can't move into #52

Closed towify closed 4 years ago

towify commented 4 years ago

Hi,

i find that there is an example in the document, "You can control the moving with coordinates of the draggable element and a mouse pointer that drags." it is really useful. but i can't find the method.

how can i set an rect hole in the containment, that the draggable element can't move into it ?

anseki commented 4 years ago

Hi @towify, thank you for the comment. You can do that easily by using onDrag event listener. Also, you can see the code of the example.

towify commented 4 years ago

@anseki thanks for replying

anseki commented 4 years ago

:smile: