问题描述
我正在使用Jquery UI选项卡,以触发显示事件,我使用以下语句 $ tabs.tabs('select',1);此代码执行后,将选项卡设置为#tabs-1,但是当已经显示#tabs-1时,我无法在同一选项卡上重新触发相同的事件.那么如何重新触发同一标签事件.
i am using Jquery UI tabs , to trigger show event i use following statement $tabs.tabs('select',1);after this code executes a tab is set to #tabs-1 but i am failed to re trigger the same event on same tab when #tabs-1 is already shown. so how to re-trigger the same tab event.
推荐答案
也许您已经知道了这一点,或者已经从其他帖子中获得了解决方案.我正在发布对我有用的答案.
Maybe you already figured this out or got the solution from some other post. I am posting an answer that works for me.
在jquery-ui-1.8.21.js
In jquery-ui-1.8.21.js
if (( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) ||
$li.hasClass( "ui-state-disabled" ) || $li.hasClass( "ui-state-processing" ) ||
self.panels.filter( ":animated" ).length ||
self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
this.blur();
return false;
}
选择选项卡的前两个条件
When a tab is selected the first two conditions
( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible)
保持为真,因此如果省略它们,则再次单击选定的选项卡将不会返回false,从而再次调用选定的选项卡上的select.
hold true so if you omit them, on clicking a selected tab again it wont return false, thus calling select on a selected tab again.
P.S-因此,我还没有看到任何缺点,因此您可以做一些额外的检查以查看它不会破坏任何东西.
P.S - I have not yet seen any disadvantages because of this, so you might do some extra checks to see it doesn't break anything.
这篇关于重新触发相同的标签索引事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!