javascript Jquery 嵌套选项卡
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8625396/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jquery nested tab
提问by Himanshu Vyas
Possible Duplicate:
Unable to get jquery tabs nested
可能重复:
无法嵌套 jquery 选项卡
I need to create a nested tab. But I didn't got a satisfied solution by google. Can anyone suggest me a solution? I am not a java script or jquery programmer.
我需要创建一个嵌套选项卡。但是我没有得到满意的谷歌解决方案。谁能建议我一个解决方案?我不是 java 脚本或 jquery 程序员。
Thanks in advance!
提前致谢!
回答by Minko Gechev
Here is solution: http://jsfiddle.net/bpJUv/1/
这是解决方案:http: //jsfiddle.net/bpJUv/1/
JS
JS
$('#tabs').tabs();
$('#tabs1').tabs();
$('#tabs2').tabs();
HTML
HTML
<div id="tabs">
<ul>
<li><a href="#tabs-1">First tab</a></li>
<li><a href="#tabs-2">Second tab</a></li>
</ul>
<div id="tabs-1">
<p>
<div id="tabs1">
<ul>
<li><a href="#tabs-11">First nested 1</a></li>
<li><a href="#tabs-12">Second nested 1</a></li>
</ul>
<div id="tabs-11">
<p>Content for first nested tab 1</p>
</div>
<div id="tabs-12">
<p>Content for second nested tab 2</p>
</div>
</div>
</p>
</div>
<div id="tabs-2">
<p>
<div id="tabs2">
<ul>
<li><a href="#tabs-21">First nested tab 2</a></li>
<li><a href="#tabs-22">Second nested tab 2</a></li>
</ul>
<div id="tabs-21">
<p>Content of first nested tab 2</p>
</div>
<div id="tabs-22">
<p>Content of second nested tab 2</p>
</div>
</div>
</p>
</div>
</div>