Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:34:39+00:00 2026-06-18T04:34:39+00:00

Tl;dr: scroll to bottom for simpler explanation. I would like to think that I’ve

  • 0

Tl;dr: scroll to bottom for simpler explanation.

I would like to think that I’ve got a slightly unique problem. First and foremost.. I have already looked over the internet/google, and the site included, as well as the suggestions when asking this question.

Back onto the subject at hand, I am generating a nested series of accordions where the amount of nesting is dynamically generated.. that is to say, there is no set limit on how many parents a bottom-level item can have, therefore it is not an option to go ‘.acord1,.acord2,.acord3’ and etc.

To the problem.. Some of the headers in the accordion are bottom-level items, they have no children, no accordion is attached.

The below example html does not contain the above said items, as it reproduces the problem faced, which is the fact that when adding the header: option(which I use to exclude the previously mentioned items), it triggers the top-level accordion, closing it when one of the children is clicked.

The below is a test case I’ve managed to reproduce with minimal code:

<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,
});

In case the above was tl;dr, specifying the header option with nested accordions does not work, as the parent of the child accordions(which are clicked), then closes.

Js Fiddle

Is there a solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:34:41+00:00Added an answer on June 18, 2026 at 4:34 am

    The below is the work-around I managed. It’s ugly, but with a few other things it gets the job done. If anyone has any better ideas than removing the icons and padding and click function of a jquery accordion header, please answer this question. Until then:

    $(".acord").accordion({
        heightStyle: "content",
        active: false,
        collapsible: true,
        changestart: function (event, ui) {
            if ($(event.currentTarget).hasClass("item")) {
                event.preventDefault();
                $(event.currentTarget).removeClass("ui-corner-top").addClass("ui-corner-all");
            }
        }
    });
    

    Edit:

    Thanks to the people over at the jQuery bug tracker, this has been solved with a much better solution:

    $(".acord").accordion({
        header: "> h3:not(.item)", //this line
        heightStyle: "content",
        active: false,
        collapsible: true
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After calling notifydatasetchanged(); I want to scroll to the bottom of list so that
EDIT : Scroll down to see the updated code. I would like to build
I have a long list of elements which I would like to scroll while
I've got a big or maybe small problem. I'm trying to scroll my website,
I'm trying to scroll to bottom of a DataGridView in a C# WinForm. This
For an iPhone app I was using window.scrollBy to scroll to the bottom of
When you scroll down to the bottom of http://www.dzone.com/links/ it automatically loads more links.
I need to be able to scroll a RichTextBox to the bottom, even when
No matter how you scroll, the div should always be at the bottom of
I'm designing a form with a horizontal scroll bar docked at the bottom. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.