Opened 13 years ago

Closed 13 years ago

#4959 closed bug (fixed)

accordion navigation failed to find header from a deeply located element

Reported by: hoball Owned by:
Priority: minor Milestone: 1.8.2
Component: ui.accordion Version: 1.7.2
Keywords: navigation, parent, level Cc:
Blocked by: Blocking:


Currently the code for the option "navigation" inside ui.accordion.js is:

if ( o.navigation ) {
	var current = this.element.find("a").filter(o.navigationFilter);
	if ( current.length ) {
		if ( current.filter(o.header).length ) { = current;
		} else { = current.parent().parent().prev();

This block of code is fixed to search 2 levels up for the header.

In my navigation menu, I am using more than 2 levels and this results a failure to make "navigation: true" works.

I have to manually fix it by adding one more parent(). Perhaps we may use the parents() method to make it more flexible.

$(document).ready(function() {
        active: false,
        header: 'h3',
        collapsible: true,
        navigation: true

<div id="accordion"><!-- START ACCORDION -->

    <h3><a href="#">Header</a></h3>
        <h4>Subheader A</h4>
            <li><a href="sub-a-1.html">Link SubA 1</a><</li>
            <li><a href="sub-a-2.html">Link SubA 2</a><</li>

        <h4>Subheader B</h4>
            <li><a href="sub-b-1.html">Link SubB 1</a><</li>
            <li><a href="sub-b-2.html">Link SubB 1</a><</li>

    <!-- // more main headers -->
</div><!-- END ACCORDION -->

Change History (2)

comment:1 Changed 13 years ago by Jörn Zaefferer

Milestone: TBD1.8

comment:2 Changed 13 years ago by Scott González

Resolution: fixed
Status: newclosed

This was fixed in a previous release. We now use .closest() instead of .parent().parent().

Note: See TracTickets for help on using tickets.