gpt4 book ai didi

jquery - jquery 中的可排序选项卡

转载 作者:行者123 更新时间:2023-12-01 00:03:00 25 4
gpt4 key购买 nike

在此示例中http://jqueryui.com/sortable/#connect-lists-through-tabs它通过选项卡连接列表。我怎样才能有可排序的选项卡?

最佳答案

有可能像JSFiddle中的这个例子一样

$(function() {
var tabs = $( "#tabs" ).tabs();
tabs.find( ".ui-tabs-nav" ).sortable({
axis: "x",
stop: function() {
tabs.tabs( "refresh" );
}
});
});
$(function() {
$( "#sortable1, #sortable2" ).sortable().disableSelection();

var $tabs = $( "#tabs" ).tabs();

var $tab_items = $( "ul:first li", $tabs ).droppable({
accept: ".connectedSortable li",
hoverClass: "ui-state-hover",
drop: function( event, ui ) {
var $item = $( this );
var $list = $( $item.find( "a" ).attr( "href" ) )
.find( ".connectedSortable" );

ui.draggable.hide( "slow", function() {
$tabs.tabs( "option", "active", $tab_items.index( $item ) );
$( this ).appendTo( $list ).show( "slow" );
});
}
});
});

关于jquery - jquery 中的可排序选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20611332/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com