Droppable Re-enable - jQuery

Demo: http://jsfiddle.net/vMQVy/2/

Take the item, put it in the basket ... Then delete this element from the basket and try to put it there again (the same or different element) ...

Droppable is still disabled

Code Part:

$(function() {
        $(".item").draggable({
                revert: 'invalid',
                cursor: 'move'

        });

        $("#items").droppable({
                drop: function( event, ui ) {
                    $("#trash").droppable( "enabled" )
                }
        });

        $("#trash").droppable({
                out: function() {
                    $(this).droppable( "enabled" )   
                },
                drop: function( event, ui ) {
                    $(this).droppable( "disable" )
                }
        });
});

Can help me with a solution?

+3
source share
1 answer

Have you tried the jqueryui documentation:

//setter
$( this ).droppable( "option", "disabled", true );
$( this ).droppable( "option", "disabled", false );
+4
source

Source: https://habr.com/ru/post/1794037/


All Articles