Reputation: 9506
I'm using jquery ui draggable, I do not want to let the user drag the helper over another element, how can I do this? I can not use snapMode: outer.
Thank you.
Upvotes: 1
Views: 353
Reputation: 262939
You can use the revert draggable option for that purpose.
If you set it to "valid"
, the drag operation will be reverted if the helper is dropped on a droppable widget. That means you only have to create such a widget around your other element:
$("#yourDraggableElement").draggable({
revert: "valid"
});
$("#yourOtherElement").droppable();
Upvotes: 1