jQuery UI remove element when dropped into a div using .droppable

前端 未结 3 1268
执念已碎
执念已碎 2021-01-01 03:29

I\'m trying to figure out the logic of how to do this.

I have many images with only a CSS class name, they are created dynamically.

These images are draggabl

3条回答
  •  余生分开走
    2021-01-01 04:06

    Better to use drop in stead of over

    $(function() {
        $(".stack").draggable();
    
        $('#trash').droppable({
            drop: function(event, ui) {
                $(ui.draggable).remove();
            }
        });
    });
    

提交回复
热议问题