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

前端 未结 3 1263
执念已碎
执念已碎 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 03:51

    Delete the elements in droppable area by implementing the following JS Code :-

    $(document).on('click', '.ui-draggable', function(){
      if(confirm('Do you want to delete ?')){
        $(this).remove();
      }
    });
    

    See the result :

提交回复
热议问题