jQuery UI draggable event handling
I want t开发者_运维问答o stop the revert event on a draggable element if that element has been dropped on a valid droppable object. How do I stop the revert from happening?
I'm assuming by "in the right place" you mean a droppable
element. If that's the case, just use the revert
option, set to 'invalid'
:
$("#drag").draggable({
revert: 'invalid'
});
Here's a working example: http://jsfiddle.net/wKBRk/
精彩评论