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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:49:52+00:00 2026-06-01T08:49:52+00:00

Apologies for the vague title, but this is quite a difficult problem to explain

  • 0

Apologies for the vague title, but this is quite a difficult problem to explain in one line!

I have an accordion with several list items and the divs which expand when each list item is clicked on. I’m using the accordion with some ajax functionality which actually removes the a list item when an action is committed, but I don’t need to explain that, the most important thing to know is that elsewhere on the page the user has the ability to remove a list item within the accordion.

The problem

Once a the active list item has been deleted, the next list item is still collapsed. What I need to do is actually have that next list item expand automatically as soon as the list item above it has been deleted.

I’ve had a look at the Jquery UI documentation and can’t seem to figure out how I can achieve this.

Code

This is the function which hides the li within the accordion:

function hideMatchBox(boxId,sourceKey){
    $('#'+boxId).animate({height: 0},1000,function(){
        var allHidden = true;
        $('#manualMatches li').each(function(index){
            if($(this).height() > 0)    {
                allHidden = false; // -failsafe
            }           
        });
        if(allHidden){
            $('#manualMatches').html('<p>All records are matched for your service.</p>');
        }
    });
}

So what I need to do is somehow tell the accordion to ‘reload’ and expand the second from top li once this hideMatchBox function has been run.

One issue with this is that there is no guarantee what order of li will be hidden, so I actually think it may be better to delete the li completely, rather than hiding it? Or perhaps move the hidden li to the bottom of the list, and then expand the first li?

Hope that makes a bit more sense! Quite difficult to provide an example but if needbe I will.

Any help will be greatly appreciated!

Thanks

  • 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-01T08:49:53+00:00Added an answer on June 1, 2026 at 8:49 am

    In the “delete” function you add something like:

    var NextIndex = $(this).closest('.div').next();
    $('#yourAccordian').accordion( "activate" , NextIndex );
    

    Or you should be able to use the same index, if you place it after the delete, depending on what function you use to remove the accordian element 🙂

    Need code, to give an concrete soloution.

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

Sidebar

Related Questions

Apologies for the vague title, it's kind of hard to explain in a line...
Apologies if this is a bit vague, but that's half of the problem. I
Firstly, apologies for the vague title, but I'm not sure exactly what I'm asking
Apologies for the appalling title. I have mocked up this code to mimic an
I apologize for vague title so let me explain. Suppose you have a page
Apologies for the title, I am unsure how to express my problem... I have
This is a very wide-ranging/vague question, but here goes. Apologies in advance. The app
Apologies in advance as I'm sure someone must have asked this before but I
Apologies for the vague title, here's my problem: The goal of my code is
Apologies for the vague question. Here it is: I have a table object created

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.