Inside the drop function, if you do:
$('#list1').droppable("disable");
$('#list2 li').draggable("disable");
You'll get:
Unprepared error: it is impossible to call drag and drop methods before initialization; tried to call the disable method
I suggest you do the same in timout funtion, like this:
if ($('#list1 li').length >= 3) {
window.setTimeout(function() {
$('#list1').droppable("disable");
$('#list2 li').draggable("disable");
}, 100)
return false;
}
working example here
source
share