How to remove an item that is pulled away from it's list?

前端 未结 2 861
名媛妹妹
名媛妹妹 2021-01-11 11:42

here is a simple question. I have a \'ul\' which i have made sortable via jquery-ui\'s sortable() function. I want to remove elements when they are dragged off the list.

2条回答
  •  清歌不尽
    2021-01-11 11:47

    I'm sure there are more than one correct way to do that but if i had to do it I would probably use a wrapper element as droppable. Why not main site container, the almighty #wrapper! Bind to drop event of the droppable and remove the item completely. It won't stay in sortable either.

提交回复
热议问题