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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:41:00+00:00 2026-06-06T05:41:00+00:00

I am working on a project where I have a horizontal navigation bar with

  • 0

I am working on a project where I have a horizontal navigation bar with 6 links, 3 of which are part of a sub navigation in the same horizontal bar. The links are represented with icons. I am looking for the easiest way to dynamically change the sub navigation when clicking on one of the main navigation icons.

[ Home - Search ]{ home1 - home2 - home3 }[ Add ]

when search is selected, it changes to:

[ Home - Search ]{ search1 - search2 - search3 }[ Add ]

This is the HTML for the bar currently. The links for the replacement icons have not been produced as it currently breaks the structure.

<nav id="navBar">
    <ul>
        <div id="mainNav">
            <li><a id="activeLink" class="homeLink" href="#">Home<a/></li>
            <li><a class="searchLink" href=#>Search<a/></li>
        </div>
        <div id="subNav">
            <li><a class="feedLink" href=#>Feed<a/></li>            
            <li><a class="messagesLink" href=#>Messages<a/></li>
            <li><a class="connectionsLink" href=#>Connections<a/></li>
        </div>
        <div id="mainNav">
            <li><a class="addLink" href=#>Add<a/></li>
        </div>
    </ul>
</nav>
<nav id="searchBar"></nav>

Any help on this would be greatly appreciated

  • 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-06T05:41:02+00:00Added an answer on June 6, 2026 at 5:41 am

    I don’t know you need to get real clever with it. Just put them together and toggle a .hidden class:

    CSS

    .hidden {
        display: none;
    }
    

    HTML

    <nav id="navBar">
        <ul>
            <li id="mainNav">
                <ul>
                    <li><a id="activeLink" class="homeLink" href="#">Home</a></li>
                    <li><a class="searchLink" href="#">Search</a></li>
                </ul>
            </li>
            <li id="subNav">
                <ul>
                    <li><a class="feedLink" href="#">Feed</a></li>            
                    <li><a class="messagesLink" href="#">Messages</a></li>
                    <li><a class="connectionsLink" href="#">Connections</a></li>
                </ul>
            </li>
            <li id="searchNav" class="hidden">
                <ul>
                    <li><a href="#">Search 1</a></li>            
                    <li><a href="#">Search 2</a></li>
                    <li><a href="#">Search 3</a></li>
                </ul>
            </li>
            <li id="mainNav">
                <ul>
                    <li><a class="addLink" href="#">Add</a></li>
                </ul>
            </li>
        </ul>
    </nav>
    

    jQuery

    $(document).ready(function(){
        var $subnavs = $('#subNav, #searchNav'),
            $search = $('#mainNav .searchLink');
    
        $search.click(function(){
            $subnavs.toggleClass('hidden');
    
            return false;
        });
    });
    

    http://jsfiddle.net/userdude/eJm2z/1

    Note, that horribly ugly menu styling is just for demonstration only…

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

Sidebar

Related Questions

I am working on a project which have some charts (graphs), tick chart, candlestick
I am working on Project where I have JQuery 1-Page Horizontal scrolling website using
Hi All I have a project working in PHP which is divided in an
I'm working on a project which should have a progressdialog. But since i didn't
I working on project and have problem with threading and update of UI. I
I have a working project that Im amending, it crashes after trying to use
I have a project working fine under MSVS 2010 SP1. I'm trying to convert
I am working on project where I have the checkInternet method in one of
I’m working on a project and have developed the high level user requirements for
I am working on a project and have the following psuedocode: // create a

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.