多层嵌套手风琴
Multi Level Nested Accordion
我想在我的代码中使用一个多级切换选项。
为此,我使用这个插件。
在那个插件中,我没有找到multi level toggle
。谁能帮我用这个插件使用多级切换。
请告诉我这个插件,因为我已经定制了很多。所以如果你推荐一个不同的插件,对我来说会更困难。
http://jsfiddle.net/99JbF/5/查看JSFiddle链接
也请查看此链接。在这里,他们给出了5个不同的嵌套手风琴演示。
下面的代码显示了多级Jquery Accordion$(document).ready(function() {
//Initialising Accordion
$(".accordion").tabs(".pane", {
tabs: '> h2',
effect: 'slide',
initialIndex: null
});
//The click to hide function
$(".accordion > h2").click(function() {
if ($(this).hasClass("current") && $(this).next().queue().length === 0) {
$(this).next().slideUp();
$(this).removeClass("current");
} else if (!$(this).hasClass("current") && $(this).next().queue().length === 0) {
$(this).next().slideDown();
$(this).addClass("current");
}
});
});
您的文件中没有包含Js和Css文件
Css: http://smartik.ws/downloads/free_demo/scripts/smk_accordion/css/smk-accordion.cssJs:
http://smartik.ws/downloads/free_demo/scripts/smk_accordion/js/smk-accordion.js检查更新的Demo
你的js代码:
jQuery(document).ready(function ($) {
$(".accordion_example1").smk_Accordion();
$(".accordion_example2").smk_Accordion({
closeAble: true,
});
$(".accordion_example3").smk_Accordion({
showIcon: false,
});
$(".accordion_example4").smk_Accordion({
closeAble: true,
closeOther: false,
});
$(".accordion_example5").smk_Accordion({
closeAble: true
});
$(".accordion_example6").smk_Accordion();
$(".accordion_example7").smk_Accordion({
activeIndex: 2
});
$(".accordion_example8").smk_Accordion();
});
您需要多级切换。我想你想要这样的答案。
jsfiddle
HTML代码
<div class="container_demo">
<div class="accordion_example2">
<!-- Section 1 -->
<div class="accordion_in">
<div class="acc_head ">Heading1</div>
<div class="acc_content">
it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
<div class="accordion_example3">
<div class="accordion_in">
<div class="acc_head ">Inner Heading1</div>
<div class="acc_content">
it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
</div>
</div>
<div class="accordion_in">
<div class="acc_head ">Inner Heading2</div>
<div class="acc_content">
it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
</div>
</div>
</div>
</div>
</div>
<!-- Section 2 -->
<div class="accordion_in">
<div class="acc_head" >Heading1</div>
<div class="acc_content">
it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
</div>
</div>
<!-- Section 3 -->
<div class="accordion_in">
<div class="acc_head" >Heading2</div>
<div class="acc_content">
it is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
</div>
</div>
</div>
</div>
jquery代码jQuery(document).ready(function($){
$(".accordion_example2").smk_Accordion({
closeAble: true,
});
$(".accordion_example3").smk_Accordion({
});
});
相关文章:
- jQuery的嵌套手风琴菜单问题
- 将多个链接表映射到嵌套的JQuery手风琴
- 关闭嵌套手风琴关闭一切
- 遍历外部嵌套的 Json 以制作手风琴菜单
- JQuery UI 嵌套手风琴 - 单击子手风琴将关闭父手风琴
- 嵌套手风琴不会以 h2 作为链接关闭
- 嵌套的 jQuery UI 手风琴不起作用
- 如何使用Adi Palaz的嵌套手风琴展开所有/折叠所有
- 在嵌套手风琴中添加淡入效果
- 嵌套手风琴
- SemanticUI手风琴-嵌套手风琴的第二级未正确打开
- JQuery 手风琴子菜单/嵌套不起作用
- 多层嵌套手风琴
- 展开/折叠所有嵌套的手风琴和非手风琴项目:BOOTSTRAP
- jQuery嵌套手风琴-禁用自动打开
- Jquery嵌套手风琴只显示一个级别
- 嵌套的UI手风琴
- Jquery UI 嵌套手风琴的问题;标头选项会干扰嵌套折叠项
- AngularJS嵌套手风琴使用ui bootstrap
- 自定义样式不影响嵌套手风琴如何修复