Finally, we got the right solution, although a bit βhackedβ. What I do is set the foreground div using draggables as droppable, but use the dropover and dropout functions to determine if the element is outside the foreground div. When it is outside the div, I bind the mouseup event to execute the drop function. When I return, I will unbind the mouseup event so that it does not fire.
Because when dragging and dropping, I already hold the mouse button, releasing it in the same way as dropping what I have in my βhandβ.
$("#foregroundDiv").droppable({ accept: ".draggableThingy", tolerance: "pointer", out: function(event, ui) { $(ui.helper).mouseup(function() { doSomethingTo(ui.draggable); }); }, over: function(event, ui) { $(ui.helper).unbind("mouseup"); } });
kasakka
source share