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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:26:08+00:00 2026-06-08T15:26:08+00:00

I have a simple jQuery script to show/hide list elements accordion-style along with a

  • 0

I have a simple jQuery script to show/hide list elements accordion-style along with a global boolean array to save which lists are shown/hidden. However, when switching from show/hiding different sublists, the boolean array goes undefined, ie (I call function with form_nav_links to show that list, then when I try to show help_nav_links right after, the array is undefined and requires an extra click). Can someone help me fix this? Here is what I have:

var listsOn = Boolean[2];
listsOn = [false, false];
var form_links = 0, help_links = 1;

function toggleView(subList) {
    var i;

    switch(subList){
        case "form_nav_links":
            i = form_links;
            break;
        case "help_nav_links":
            i = help_links;
            break;
        };

    if(listsOn[i]){
        $("." + subList).slideUp(1000);
        listsOn[i] = false;
        }
    else {
        $("." + subList).slideDown(1000);
        listsOn[i] = true;
        }

Thanks in advance!

  • 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-08T15:26:10+00:00Added an answer on June 8, 2026 at 3:26 pm

    I solved the issue by using slideToggle() instead

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

Sidebar

Related Questions

I have a simple hide show jquery script I grabbed from an example site.
I have a simple show/hide jquery script that works fine on its own, The
I have a simple script to hide/show a table row. I'd like it to
I have a simple jQuery script that I'm trying to build upon but I
I have a very simple jQuery script.. all I want it to do is
I have created a simple JQuery script with hovering effect on some links. The
I have this simple function: <script type=text/javascript> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); });
Hi i have a simple accordion set up with jQuery with the HTML structure
I have a simple file that has a Jquery script it in that looks
I have some simple jQuery toggle script like this: <script type=text/javascript> $(document).ready(function() { $('#clickedit').click(function()

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.