可排序 - 删除 link 并在占位符之间交换

Sortable - delete link and swapping between placeholder

如何制作一个 link 来 remove(恢复)左侧主列表中的占位符元素?

就这样 https://jqueryui.com/droppable/#photo-manager

另外,除了左边的列表,我还为占位符写了limit 1。但是占位符之间如何交换?

DEMO

示例attjqueryui.com中已经有恢复已删除项目的功能。

// image recycle function
var trash_icon = "<a href='link/to/trash/script/when/we/have/js/off' title='Delete this image' class='ui-icon ui-icon-trash'>Delete image</a>";
function recycleImage( $item ) {
  $item.fadeOut(function() {
    $item
      .find( "a.ui-icon-refresh" )
        .remove()
      .end()
      .css( "width", "96px")
      .append( trash_icon )
      .find( "img" )
        .css( "height", "72px" )
      .end()
      .appendTo( $gallery )
      .fadeIn();
  });
}

应该也适合你。