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 338887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:28:17+00:00 2026-05-12T10:28:17+00:00

Ok, so somewhere, something is wrong. When I was using version 1.3 the accordion

  • 0

Ok, so somewhere, something is wrong. When I was using version 1.3 the accordion was working fine. When I upgraded jQuery to version 1.3.2 it now no longer works as it’s supposed to. I need the latest version because it is solving some errors that IE6 was throwing up…

So here’s the code, and what needs to change in order for it to work with jQuery’s latest vesion?

$(function() {

$(".accordion h4").eq(2).addClass("active");
$(".accordion div").eq(2).show();
$(".accordion h4").click(function(){
    $(this).next(".accordion div").slideToggle("slow")
    .siblings("div:visible").slideUp("slow");
    $(this).toggleClass("active");
    $(this).siblings("h4").removeClass("active");
});
$("div.accordion div").hide();
$("h4#open").trigger('click');

});

HTML goes something like:

<div class="accordion">

<h4 id="open">Content header</h4>

<div>
<ul>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
</ul>

</div>

<h4>Content header</h4>

<div>
<ul>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
</ul>

</div>

<h4>Content header</h4>

<div>
<ul>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
<li><strong>Something</strong> <em>Else</em></li>
</ul>

</div>

I should note, that where it is not working, is that when expanding a second panel, the first panel should collapse as normal – but with 1.3.2 it is not the case…


*I have updated the HTML with what I really had going on, as it seems that it was the HTML/CSS that was giving problems.

I had the CSS set to:

li strong{display:block;float:left;width:250px;background:#ccc;}
li em{display:block;float:left;width:700px;background:#ddd;}

in order for it to give a “2-columned table-like” effect (and for easy client-CMS editing – hit the “bold” button and hit the “i” button) – but it seems that it was this floating of the elements that made the accordion not work. When I removed the “float: left;” – it worked again as normal.

And it doesn’t take away from the fact that this same set-up works with jquery1.3.0 but not with jquery1.3.2 – so something is still amiss!

  • 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-05-12T10:28:17+00:00Added an answer on May 12, 2026 at 10:28 am

    I believe your selector $(this).next(".accordion div") will not work. next() only grabs the next sibling therefore doing a filter that looks at children is odd.

    Also try to use selectors with a nodeName rather than a pure css class selector.
    Use div.accordian rather than just .accordian in your js

    Try

     $(function() {
       $("div.accordion h4").eq(2).addClass("active");
       $("div.accordion div").eq(2).show();
    
       $("div.accordion h4").live('click', function(){
           var $el = $(this);
           $el.next()
              .slideToggle("slow")
              .siblings("div:visible")
              .slideUp("slow");
           $el.toggleClass("active");
           $el.siblings("h4").removeClass("active");
       });
    
       $("div.accordion div").hide();
    
       $("h4#open").trigger('click');
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 166k
  • Answers 166k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer var el = $('input[id$=mode]'); if ( el.length ) { alert(… May 12, 2026 at 1:25 pm
  • Editorial Team
    Editorial Team added an answer Use doc.Load(xmlPath). LoadXML is for loading an XML string. May 12, 2026 at 1:25 pm
  • Editorial Team
    Editorial Team added an answer I'd guess that you are using a storage engine that… May 12, 2026 at 1:25 pm

Related Questions

I have a problem, which I do not seem to be able to solve...
I'm kind of interested in getting some feedback about this technique I picked up
I'm trying to call my good old 'RegisterClientScriptBlock' on the friendly 'ScriptManager' class. It
In Toyota manufacturing lines they always know what path a part have traveled. Just

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.