显示回调未触发jquery ui选项卡 [英] Show callback is not firing jquery ui tabs
问题描述
我正在关注以下示例: http://jsfiddle.net/Shef/k6TEZ/,其中使用callback
show()
.
我也正在执行此callback
,但是它似乎不起作用.这是我的 html 和 jquery
I was following these example : http://jsfiddle.net/Shef/k6TEZ/ , in which is used the callback
show()
.
I am executing this callback
too , but it seems to not work. here it is my html and jquery
HTML
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
<li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<p>Proin elit arcu,mpus lectus.</p>
</div>
<div id="tabs-2">
<p>Morbi tincidunt, d</p>
</div>
<div id="tabs-3">
<p>Mauris eleife.</p>
</div>
</div>
jquery
$("#tabs").tabs({
show: function(event,ui){
console.log("shown"+ui.index);
}
});
$( "#tabs" ).find( ".ui-tabs-nav" ).sortable({
axis: "x"
});
//tabsactivate
//tabsshow
$('#tabs').on('tabsactivate', function(event, ui) {
$(ui.newTab).data('index',ui.newTab.index());
console.log($(ui.newTab).data('index'),ui.newTab.index());
});
有人可以帮我弄清楚为什么show()
没有开火吗?
Can someone help me to undestand why show()
is not firing?
使用 jquery ui 1.10无法正常工作.使用1.9.2即可.
with jquery ui 1.10 it is not working. With 1.9.2 it works.
推荐答案
不推荐使用:show event;重命名以激活.
Deprecated: show event; renamed to activate.
并根据 jQuery UI 1.10更改日志:
已删除:显示事件.
Removed: show event.
看起来您应该使用 activate
或
Looks like you should use either activate
or beforeActivate
.
这篇关于显示回调未触发jquery ui选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!