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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:52:04+00:00 2026-06-17T09:52:04+00:00

I am trying to implement a navigation menu that has a block of UL

  • 0

I am trying to implement a navigation menu that has a block of UL > LI within it:

<aside id="nav-container" role="complementary" style="width: 232px;">
  <nav class="overview" id="primary-nav" role="nav" style="display: block;">
    <h3 class="section">
      <span class="menu-toggle"></span>
      <span>The Basics</span>
    </h3>
    <ul class="depth-1 shortcuts" style="display: none;">
      <li><a href="#" class="nav-link">Introduction</a></li>
      <li><a href="#" class="nav-link">A Chapter in the Zeitgeist Movement</a></li>
      <li><a href="#" class="nav-link">Getting Real with expectations</a></li>
      <li><a href="#" class="nav-link">Point of Focus in a chapter</a></li>
    </ul>
    <h3 class="section">
      <span class="menu-toggle"></span>
      <span>Setting up a National Chapter</span>
    </h3>
    <ul class="depth-1 shortcuts" style="display: none;">
      <li><a href="#" class="nav-link">Gathering Volunteers &amp; Social Media</a></li>
      <li><a href="#" class="nav-link">Establishing a Website &amp; Tools</a></li>
      <li><a href="#" class="nav-link">Organising a Core Group</a></li>
      <li><a href="#" class="nav-link">Expanding into Regional Chapters</a></li>
    </ul>
    <h3 class="section">
      <span class="menu-toggle"></span>
      <span>Setting up a city or local Chapter</span>
    </h3>
    <ul class="depth-1 shortcuts" style="display: none;">
      <li><a href="#" class="nav-link">Introduction</a></li>
      <li><a href="#" class="nav-link">Getting Started</a></li>
      <li><a href="#" class="nav-link">Raising Volunteers</a></li>
      <li><a href="#" class="nav-link">Organising a Core Group</a></li>
    </ul>
    <h3 class="section">
      <span class="menu-toggle"></span>
      <span>Organising Events</span>
    </h3>
    <ul class="depth-1 shortcuts" style="display: none;">
      <li><a href="#" class="nav-link">Types of Events</a></li>
      <li><a href="#" class="nav-link">Finding a Space</a></li>
      <li><a href="#" class="nav-link">Gathering Materials</a></li>
      <li><a href="#" class="nav-link">Promoting the Event</a></li>
      <li><a href="#" class="nav-link">Executing the Event</a></li>
    </ul>
    <h3 class="section">
      <span class="menu-toggle"></span>
      <span>Organising Project Teams</span>
    </h3>
    <ul class="depth-1 shortcuts" style="display: none;">
      <li><a href="#" class="nav-link">“Your idea, your project” concept</a></li>
      <li><a href="#" class="nav-link">Guidelines</a></li>
      <li><a href="#" class="nav-link">Project Methodology</a></li>
      <li><a href="#" class="nav-link">Devising a Project Structure</a></li>
      <li><a href="#" class="nav-link">Organising Volunteers </a></li>
    </ul>
    <h3 class="section">
      <span class="menu-toggle"></span>
      <span>Appendix</span>
    </h3>
    <ul class="depth-1 shortcuts" style="display: none;">
      <li><a href="#" class="nav-link">Tips from Coordinators</a></li>
      <li><a href="#" class="nav-link">Tips on DVDs</a></li>
    </ul>
  </nav>
</aside>

Initially all the are closed, when I click on an h3, the ul list turns to

I have this javascript code:

  // menu open close
  this.leftMenuToggle = function () {
    var leftMenuToggle = $( ".section" ).on( "click", function( event ) {
      event.preventDefault();
      leftMenuToggle.toggleClass("active");
      leftMenuToggle.next().css('display', 'block');
      console.log('we clicked this menu item');
    });
  }

But it opens all the .section items, what is the correct way to alter my code so that if I click on … it opens only the child ul list?

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-17T09:52:05+00:00Added an answer on June 17, 2026 at 9:52 am

    The following way you can remove the hardcoded style from your lists and when you click the link the list toggles.

    Javascript

    $('#nav-container').on('click', '.section', function(e) {
        e.preventDefault();
    
        var $shortcut = $(this).next();
        $('#nav-container ul.active').not($shortcut).removeClass('active');
        $shortcut.andSelf().toggleClass('active');
    });
    

    CSS

    ul.active {
        display: block;
    }
    
    ul:not(.active) {
      display: none;
    }
    

    demo

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

Sidebar

Related Questions

I'm trying to implement a simple horizontal navigation menu that just shows a single
I am trying to implement Breadcrumb Navigation on a WebPage that exchanges a content
I am trying to implement a pageController within a Navigation Controller. For example ViewController
I'm trying to implement a Jquery Javascript menu onto a webpage. Jquery code: $(.navigation
I am trying to implement a tab-style navigation system in my app (similar to
I'm trying to implement a horizontal multilevel dropdown navigation menu. Immediately below (vertically) the
I am trying to implement html5's pushstate instead of the # navigation used by
I'm trying to implement a menu in the footer of an app, similar to
I am trying to implement navigation like in Tree Based Navigation but based on
I'm trying to implement a navigation controller with some hierarchical views. I want to

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.