Is it possible to have an accordion embedded in another accordion with jQuery UI?
-Item One
-Item Two
-Item Three
--Sub One
--Sub Two
--Sub Three
-Item Four
Where Sub One through Four is another accordion.
Thanks
jQuery UI Accordian is an expandable and collapsible content holder that is broken into sections and probably looks like tabs. Syntax: You can use the accordion () method in two forms: $(selector, context).
Your append string needs to be terminated with single quotes since you are using double quotes with it. Also you need to include Jquery library. If you are using the jquery accordion you also need to include the Jquery UI library. Also your html is a bit off, here is a working example.
$('#accordion'). activate('activate',117);
In web design, an accordion is a type of menu that displays a list of headers stacked on top of one another. When clicked on (or triggered by a keyboard interaction or screen reader), these headers will either reveal or hide associated content.
Give each container that you want to make an accordion a class like accordion
and use:
$(".accordion").accordion();
Just give different id
names for each accordion and call them in the jquery function an you would have to edit the css to get the desired look though.
$(function() {
$( "#accordion,#accordion2" ).accordion();
});
DEMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With