问题描述
我正在使用Tabify http://unwrongest.com/projects/tabify 来显示标签. /p>
我正在努力弄清楚如何以编程方式更改选项卡.
这是一个工作示例: http://jsfiddle.net/S78Bt/
$(document).ready(function(){
$('#menu').tabify();
});
尽管我知道使用JQuery UI选项卡可以实现此行为,但是由于某些不可避免的情况,我需要使用tabify.
您正在使用的项目似乎已死,它最近没有收到更新,也没有文档.
我看过源代码,没有API可以直接为您访问标签.
唯一的解决方案是通过查看库如何期望选项卡更改来间接入侵:
function changeTab(name) {
location.hash = name + '-tab';
}
这适用于我的示例.
I am using tabify http://unwrongest.com/projects/tabify to show tabs.
I am struggling to figure out how to change the tab programmatically.
Here is one working example: http://jsfiddle.net/S78Bt/
$(document).ready(function(){
$('#menu').tabify();
});
Although I know that using JQuery UI tabs I can acheive this behavior, but due to some unavoidable circumstances I need to use tabify.
The project you are using seems dead, it hasn't received updates lately, it does not have documentation.
I've taken a look at the source code, there is no API to access tabs for you directly.
The only solution is to hack indirectly by seeing how the library expects the tabs to change:
function changeTab(name) {
location.hash = name + '-tab';
}
This works on my example.
这篇关于使用Tabify jQuery插件以编程方式更改Tab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!