当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。