I am using jQuery draggable and droppable. Sometimes I want to cancel the drop even though the thing being dragged is 'acceptable' to the target. I only know whether the drop can proceed once the user has released the mouse button (not whilst actually still dragging, which is how 'accept' seems to work). Is there any way of 'cancelli开发者_StackOverflow中文版ng' the drop within the drop function, or is there another way around this issue? Thanks very much.
.draggable()
elements fire a .stop()
event when the user has completed the drag. You can override the default method with a custom method in the draggable instantiation:
http://jqueryui.com/demos/draggable/
$( ".selector" ).draggable({
stop: function(event, ui) { ... }
});
精彩评论