當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JQuery UI Sortable connectWith用法及代碼示例

用法:

connectWith
類型:Selector
默認:false
此列表中的項目應連接到的其他可排序元素的選擇器。這是 one-way 關係,如果您希望項目在兩個方向上連接,則必須在兩個可排序元素上設置 connectWith 選項。

代碼示例:

使用指定的 connectWith 選項初始化可排序:

$( ".selector" ).sortable({
  connectWith: "#shopping-cart"
});

初始化後獲取或設置connectWith選項:

// Getter
var connectWith = $( ".selector" ).sortable( "option", "connectWith" );
 
// Setter
$( ".selector" ).sortable( "option", "connectWith", "#shopping-cart" );

相關用法


注:本文由純淨天空篩選整理自jqueryui.com大神的英文原創作品 Sortable connectWith。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。