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

  • Home
  • SEARCH
  • 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 6924429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:39:42+00:00 2026-05-27T10:39:42+00:00

I require some help creating a navigation bar in jQuery, If you check out

  • 0

I require some help creating a navigation bar in jQuery, If you check out the JS fiddle you should understand what effect I am trying to get. I’ve got it doing what I want apart from when you press on a dublink (I don’t want it to slide up when a sublink is clicked)

Cheers for any 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-27T10:39:43+00:00Added an answer on May 27, 2026 at 10:39 am

    First of all, you will only want to bind the click event to the first row of children, where as you specify to bind it to all li elements that exist within your root ul.

    Second, you will probably want to bind the click event to the a element, as a click on any of the children that exists within the first row of li elements (where you want the click event to be bound to) will trigger that exact same click event. This is due to the fact that you actually did click the li via one of it’s childrens.

    Let’s see if this piece of re-written code can get you started:

    http://jsfiddle.net/Ay6Xs/10/

    (I did some HTML rewriting as well, so applied some copy-pasta)

    Here’s the code from jsfiddle:

    $(document).ready(function()
    {
        // hides all admin control elements (drop down)
        $("#navigation_bar ul").hide();
    
        // Only bind click handler to direct li > a children
        $("#navigation_bar > li > a").click(function(e)
        {
            // Slide up every single ul
            $("#navigation_bar ul").slideUp();
    
            $(this).siblings()
                .stop()
                .slideToggle();
    
         });
    });
    

    HTML:

    <ul id="navigation_bar">
        <li>
            <a id="database" href="javascript:void(0)">
                <img class="icon" src="images/icon/homeico.png"/>
                Dashboard
            </a>
            <ul>
                <li>
                    <a href="#">> Inbox</a>
                </li>
                <li>
                    <a href="#">> Sent</a>
                </li>
                <li>
                    <a href="#">> Search</a>
                </li>
            </ul>
        </li>
        <li>
            <a id="database" href="#">
                <img class="icon" src="images/icon/mailico.png"/>
                Messages
            </a>
            <ul>
                <li>
                    <a href="#">> Inbox</a>
                </li>
                <li>
                    <a href="#">> Sent</a>
                </li>
                <li>
                    <a href="#">> Search</a>
                </li>
            </ul>
        </li>
        <li>
            <a id="database" href="#">
                <img class="icon" src="images/icon/homeico.png"/>
                Dashboard
            </a>
            <ul>
                <li>
                    <a href="#">> Inbox</a>
                </li>
                <li>
                    <a href="#">> Sent</a>
                </li>
                <li>
                    <a href="#">> Search</a>
                </li>
            </ul>
        </li>
        <li>
            <a id="database" href="#">
                <img class="icon" src="images/icon/mailico.png"/>
                Messages
            </a>
            <ul>
                <li>
                    <a href="#">> Inbox</a>
                </li>
                <li>
                    <a href="#">> Sent</a>
                </li>
                <li>
                    <a href="#">> Search</a>
                </li>
            </ul>
        </li>
        <li>
            <a id="database" href="#">
                <img class="icon" src="images/icon/homeico.png"/>
                Dashboard
            </a>
            <ul>
                <li>
                    <a href="#">> Inbox</a>
                </li>
                <li>
                    <a href="#">> Sent</a>
                </li>
                <li>
                    <a href="#">> Search</a>
                </li>
            </ul>
        </li>
        <li>
            <a id="database" href="#">
                <img class="icon" src="images/icon/mailico.png"/>
                Messages
            </a>
            <ul>
                <li>
                    <a href="#">> Inbox</a>
                </li>
                <li>
                    <a href="#">> Sent</a>
                </li>
                <li>
                    <a href="#">> Search</a>
                </li>
            </ul>
        </li>
    </ul>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help figuring out the best way to proceed with creating a
i'm looking for some help in creating a faceted plot with angeled x-axis tick
I'm looking for some help creating a regex that requires 8 char (at a
Im creating an application, wich will conect to several sql database and get some
I needed some help with creating custom trees given an arithmetic expression. Say, for
I have some problem trying to understand when building a rails app with several
I am creating a rails app which will help out businesses. These businesses have
I need some help on figuring out a way to store my data that
I'm working on a Google App Engine program that will require some basic spell
I'm looking to design an application that will require some deep control over IP

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.