jQuery UI Draggable/Sortable - Get reference to new item

前端 未结 3 2007
半阙折子戏
半阙折子戏 2020-12-14 19:31

I am using the jQuery UI Draggable/Sortable demo (http://jqueryui.com/demos/draggable/#sortable) for the basis of my project. I need to get a reference to the

3条回答
  •  一生所求
    2020-12-14 20:18

    And if you want another very rough-and-ready way to get that item just to remove it or something, just reference it in the drop as

    var _clone = $(".ui-draggable-dragging");
    

    Of course that class is removed just AFTER the drop, so that reference gets lost and you can't do anything that isn't immediate.

    The answer above is more robust but if you're in a crazy rush...

提交回复
热议问题