// in your click event
var selected_exists = $('#yourTabBox')
.children('ul.ui-tabs-nav')
.children('li.ui-tabs-selected')
.length;
if (selected_exists) {
// Nothing is collapsed
} else {
// collapsed
}
$(".selector").tabs({
collapsible: true,
select: function(event, ui)
{
var prevSelectedIndex = $(".selector").tabs('option', 'selected');
var nextSelectedIndex = ui.index;
if(prevSelectedIndex === -1)
{
// It was previously collapsed and the user is now opening
// tab at index: nextSelectedIndex
}
else if(prevSelectedIndex === nextSelectedIndex )
{
// The user has clicked on the currently opened
// tab and it is collapsing
}
}
});
2条答案
按热度按时间luaexgnf1#
您可以在单击时检查
ui-tabs-selected
类是否存在。这是完美的
select
事件。6yt4nkrj2#
你不知道哪一个被藏起来了?
也许甚至选择事件可能是你想要的。
使用“tabsselect”事件: