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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:44:38+00:00 2026-05-15T05:44:38+00:00

I have a sidebar with collapsible menu it works fine but all the values

  • 0

I have a sidebar with collapsible menu it works fine but all the values come expanded the initial loading time.I want it to be closed on load and toggled thereafter.

Here is the jquery used

// Sidebar Toggle
var fluid = {
Toggle : function(){
    var default_hide = {"grid": true };
    $.each(
        ["pagesnav", "commentsnav", "userssnav", "imagesnav"],
        function() {
            var el = $("#" + (this == 'accordon' ? 'accordion-block' : this) );
            if (default_hide[this]) {

                el.hide();
                $("[id='toggle-"+this+"']").addClass("hidden");

            }
            $("[id='toggle-"+this+"']")
            .bind("click", function(e) {
                if ($(this).hasClass('hidden')){
                    $(this).removeClass('hidden').addClass('visible');
                    el.slideDown();
                } else {
                    $(this).removeClass('visible').addClass('hidden');
                    el.slideUp();
                }
                e.preventDefault();
            });
        }
    );
}
}
jQuery(function ($) {
    if($("[id^='toggle']").length){fluid.Toggle();}
});

here is the html

<span class="ul-header"><a id="toggle-pagesnav" href="#" class="toggle visible">Content</a></span>
      <ul id="pagesnav">
        <li><a class="icn_manage_pages" href="#">Manage Pages</a></li>
        <li><a class="icn_add_pages" href="#">Add Pages</a></li>
        <li><a class="icn_edit_pages" href="#">Edit Pages</a></li>
        <li><a class="icn_delete_pages" href="#">Delete Pages</a></li>
      </ul>
      <!-- End Content Nav  --> 
      <!-- Start Comments Nav  --> 
      <span class="ul-header"><a id="toggle-commentsnav" href="#" class="toggle visible">Comments</a></span>
      <ul id="commentsnav">
        <li><a class="icn_manage_comments" href="#">Manage Comments</a></li>
        <li><a class="icn_add_comments" href="#">Add Comments</a></li>
        <li><a class="icn_edit_comments" href="#">Edit Comments</a></li>
        <li><a class="icn_delete_comments" href="#">Delete Comments</a></li>
      </ul>

here is the css used

.toggle {
    display:block;
}
.ul-header a.visible {
    background:url('../img/icons/small/toggle_close.png') no-repeat scroll 97% 50%;
}
.ul-header a.hidden {
    background:url('../img/icons/small/toggle_open.png') no-repeat scroll 97% 50%;
}

Please help.

  • 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-15T05:44:39+00:00Added an answer on May 15, 2026 at 5:44 am

    This is the variable which is checked against to see if a block has to be hidden or not.
    var default_hide = {"grid": true };

    Change it to

    var default_hide = {"pagesnav": true, "commentsnav": true, "userssnav": true, "imagesnav": true}
    

    and it should work.

    Or you can remove this if:

    if (default_hide[this])
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sidebar that I want to behave like it's frozen on the
I have a sidebar defined in my main layout which most of the time
For instance, i want to have my sidebar to have several dynamic content. Using
I want to have 4 links in the sidebar of master page which every
I have a sidebar menu that opens and closes hidden parts of the page
I have the fullcalendar working. But i have a sidebar users can collapse this
I'm working on a blog application, and I want to have a sidebar that
I have a sidebar navigation that lists blog entry titles down the side of
I have an Outlook style app. So basically I have a sidebar on the
I am using the toggle() with jQuery and I have a sidebar on my

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.