Opened 8 years ago

Closed 8 years ago

#9020 closed bug (notabug)

Nested accordions don't work with header option specified

Reported by: Daedalus Owned by:
Priority: minor Milestone: none
Component: ui.accordion Version: 1.9.2
Keywords: Cc:
Blocked by: Blocking:

Description

Specifying the header option with nested accordions does not work, as the parent of the child accordions(which are clicked), then closes.

Specifying a different Id for multiple nested accordions isn't always an option, such as when the levels of accordions are generated dynamically(there can be any number of levels).

<div class="acord">
    <h3>test1</h3>
    <div class="acord">
        <h3>test2</h3>
        <div>test2cont</div>
    </div>
    <h3 class="item">test3</h3>
</div>
$(".acord").accordion({
    header: "h3:not(.item)",
    heightStyle: "content",
    active: false,
    collapsible: true
});

JsFiddle demonstrating problem: Open the first accordion header, then attempt to open the child accordion header.

Change History (1)

comment:1 Changed 8 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Hi Daedalus,

Thanks for taking the time to contribute to the jQuery UI project. In this case you need to configure the header option correctly so that it doesn't pick up on items that you want to be a nested accordion.

In the case of your example "< h3:not(.item)" will work - http://jsfiddle.net/tj_vantoll/bFaMj/.

Note: See TracTickets for help on using tickets.