I need only 1 block in one drop-area and switch if needed. Why I can disable, but can't enable a droppable function?
$(this).droppable("option", "disabled", false);
- doesn't work$(this).droppable("enable");
- doesn't work- Enable a droppable after it has being disable - doesn't work
Here is my code:
$('.my_block').draggable({
revert: "invalid",
});
$('.free').droppable({
accept: ".my_block",
drop: function(ev, ui) {
$(this).removeClass("free");
$(this).addClass("1");
ui.draggable.appendTo($(this)).removeAttr('style');
$(this).droppable("disable");
},
out: function(ev, ui) {
$(this).droppable("enable");
$(this).removeClass("1");
$(this).addClass("free");
},
});
jsfiddle http://jsfiddle.net/4ABCN/2/
And how can I back all red blocks to main positions by one button?