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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:04:13+00:00 2026-05-20T06:04:13+00:00

I have a nav bar, what I need is that when you click on

  • 0

I have a nav bar, what I need is that when you click on an link its corresponding DIV should slide down/up.

My problems are that all the DIVs are sliding down and when clicking on the same link all DIVs AND the nva items slide up.

How can I make this work right?

My HTML:

<div id="megamenus" class="click-menu">
  <h6><span>Products &amp; Services</span></h6>
  <h6><span>Support &amp; Training</span></h6>
  <h6><span>Communities</span></h6>
  <h6 class="new-window"><span>Store</span></h6>

  <div class="menu-container">aaaa</div>    
  <div class="menu-container" id="training-n-support">bbbb</div>
  <div class="menu-container">cccc</div>
</div>

My jQuery:

$('.click-menu div.menu-container').hide();
$('.click-menu h6 span').click(function() {
  if ($(this).hasClass('selected')) {
    $(this).removeClass('selected');
    $(this).parent().siblings().stop(true, true).slideUp('slow', function() {
        $('h4').css('z-index', '1');
    });

 } else {
    $('.click-menu h6 span').removeClass('selected');
    $(this).addClass('selected');
    $('.click-menu div.menu-container').slideUp('slow');
    $(this).parent().siblings().stop(true, true).slideDown('');
    $('h4').css('z-index', '0');
 }
});

Here’s the DEMO.

Any help would 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-05-20T06:04:13+00:00Added an answer on May 20, 2026 at 6:04 am

    You are telling all siblings of the parent to slide, not qualifying it further like this .siblings('selector-for-intended-element')

    See JsFiddle for my recommendation : http://jsfiddle.net/BGBaH/1/

    I recommend you put the divs directly after the menu items, and just use .next()

    UPDTE

    If you don’t want to do that, here is a jsfiddle that more closely resembles what you originally asked for I believe

    http://jsfiddle.net/BGBaH/2/

    I just added id’s to your span menu items, and added matching classes to the corresponding divs. Then I qualified the .siblings() function with the proper class selector.

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

Sidebar

Related Questions

In my view I need to have two left buttons on my nav bar.
I have a nav bar that when I over over an element the next
I have a nav bar in my footer of my page which is all
I have a nav bar on my site that is currently one color and
I have a horizontal nav bar that is an unordered list with anchor tags.
I have a nav bar with children unordered lists nested under the main navbar
I have a navbar that drops down. The parent text is black, when you
I have nav code like this in my HTML file: <div id="center_links"> <ul> <li><a
I have a nav that has subnavs. When the user hovers over the li's
I have the following Nav: <li id=categories> <ul> <li class=cat-item cat-item-8 current-cat><a href=#>Link</a> <ul>

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.