Sunday, 15 July 2012

user interface - jQuery Droppable: dropping outside div? -


Is there any way that I can get jQuery to execute a function when you have a drop out of a droppable div Drag the item?

We say that we have dragable or sortable items in a single divas and if they are left outside of their parent div, then you want to remove them.

I know that there is an "out" event but whatever works as soon as you drag the item out of the divas, when you do not drop it (release the mouse button).

Finally found a proper solution, even if it is a bit "hockey". What do I do, I set the foreground dish as droppable with dragables, but use the dropover and dropout features to ensure that the item is outside the foreground, when it is outside the divide, So I force the mouseup event to drop functionality. When it comes back I open the mouseup event, so it is not a fire.

Because while dragging, I'm already pressing the mouse button, releasing it is like falling into my hand. " ("Acceptable": "drag-able", tolerance: "indicator", out: function (event, UI) {$ (ui.helper) .mouseup (function () {doSomethingTo (ui.draggable);}) ;}, Over: function (Event, UI) {$ (ui.helper). Unbund ("mouseup")}}});


No comments:

Post a Comment