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

  • Home
  • SEARCH
  • 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 8823173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:17:15+00:00 2026-06-14T06:17:15+00:00

I have some code that is generated using php. It outputs a nested accordion.

  • 0

I have some code that is generated using php. It outputs a nested accordion. For some reason the accordion looks very screwed up. So much so that I can’t even explain. Here is the code that is generated:

<div class='accordion'>
    <h3>2012</h3>
    <div class='accordion'>
        <h3>October 2012</h3>
        <div>October 5, 2012</div>
        <div>October 5, 2012</div>
        <div>October 4, 2012</div>
        <div>October 4, 2012</div>
        <div>October 4, 2012</div>
        <div>October 3, 2012</div>
        <div>October 3, 2012</div>
        <div>October 3, 2012</div>
        <div>October 1, 2012</div>
        <div>October 1, 2012</div>
        <div>October 1, 2012</div>
        <div>October 1, 2012</div>
    </div>
    <div class='accordion'>
        <h3>September 2012</h3>
        <div>September 30, 2012</div>
        <div>September 29, 2012</div>
        <div>September 29, 2012</div>
        <div>September 26, 2012</div>
        <div>September 26, 2012</div>
        <div>September 25, 2012</div>
        <div>September 24, 2012</div>
        <div>September 19, 2012</div>
        <div>September 19, 2012</div>
        <div>September 19, 2012</div>
        <div>September 19, 2012</div>
        <div>September 19, 2012</div>
        <div>September 11, 2012</div>
        <div>September 5, 2012</div>
    </div>
    <div class='accordion'>
        <h3>August 2012</h3>
        <div>August 19, 2012</div>
        <div>August 17, 2012</div>
        <div>August 9, 2012</div>
        <div>August 4, 2012</div>
        <div>August 4, 2012</div>
        <div>August 4, 2012</div>
        <div>August 4, 2012</div>
        <div>August 4, 2012</div>
        <div>August 4, 2012</div>
        <div>August 2, 2012</div>
    </div>
    <div class='accordion'>
        <h3>July 2012</h3>
        <div>July 1, 2012</div>
        <div>July 1, 2012</div>
    </div>
</div>

I call it using:

$(document).ready(function(){
    $('div.accordion').accordion({
            autoHeight:false,
            collapsible:true,
            active:false});
});

This looks like it should work. To see what it’s doing go to:
http://lonewolfdigital.com/misc/test/

  • 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-14T06:17:16+00:00Added an answer on June 14, 2026 at 6:17 am

    An accordion has a heading.. then it’s contents.. so what you want is this structure

    <div class='accordion'> <!-- tells its an accordion -->
         <h3>2012</h3> <!-- this is the first heading  -->
    
        <div class='accordion'> <!-- tells its another accordion  -->
             <h3>October 2012</h3> <!-- first heading  -->
    
            <div> <!-- the headings content - only one content per heading and so on  -->
                <div>October 5, 2012</div>
                <div>October 5, 2012</div>
                <div>October 4, 2012</div>
                <div>October 4, 2012</div>
                <div>October 4, 2012</div>
                <div>October 3, 2012</div>
                <div>October 3, 2012</div>
                <div>October 3, 2012</div>
                <div>October 1, 2012</div>
                <div>October 1, 2012</div>
                <div>October 1, 2012</div>
                <div>October 1, 2012</div>
            </div>
             <h3>September 2012</h3>
    
            <div>
                <div>September 30, 2012</div>
                <div>September 29, 2012</div>
                <div>September 29, 2012</div>
                <div>September 26, 2012</div>
                <div>September 26, 2012</div>
                <div>September 25, 2012</div>
                <div>September 24, 2012</div>
                <div>September 19, 2012</div>
                <div>September 19, 2012</div>
                <div>September 19, 2012</div>
                <div>September 19, 2012</div>
                <div>September 19, 2012</div>
                <div>September 11, 2012</div>
                <div>September 5, 2012</div>
            </div>
             <h3>August 2012</h3>
    
            <div>
                <div>August 19, 2012</div>
                <div>August 17, 2012</div>
                <div>August 9, 2012</div>
                <div>August 4, 2012</div>
                <div>August 4, 2012</div>
                <div>August 4, 2012</div>
                <div>August 4, 2012</div>
                <div>August 4, 2012</div>
                <div>August 4, 2012</div>
                <div>August 2, 2012</div>
            </div>
             <h3>July 2012</h3>
    
            <div>
                <div>July 1, 2012</div>
                <div>July 1, 2012</div>
            </div>
        </div>​
    </div>
    

    http://jsfiddle.net/c8qW3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some PHP code that generates a calendar and then outputs html to
I have a table generated from some PHP code that lists a SMALL amount
I have some JavaScript, which is generated by PHP code, using a template. The
I have a trivia page that is dynamically generated by some javascript code. It
I have some PHP code that generates dynamic tables of data on the fly.
I have some C# code that generates google maps. This codes looks at all
I have a table that has been generated dynamically using PHP. The table has
Using PHP, what are some ways to generate a random confirmation code that can
I have a PHP script that I am using to generate some rather complicated
I have some code that generates Visio masters for me, and some masters have

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.