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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:45:18+00:00 2026-06-15T22:45:18+00:00

I have a pretty simple navigation element that I’ve made. It looks fine in

  • 0

I have a pretty simple navigation element that I’ve made.

It looks fine in Chrome and Safari, but when I went to view it in Firefox I noticed that the hidden piece of the navigation “jumps” up when you roll over “About”. I am using a CSS reset.

The HTML:

<nav>
    <ul class="menu">
        <li>
            <a>About</a>
            <ul class="sub-menu">
                <li><a>People</a></li>
                <li><a>Approach</a></li>
            </ul>
        </li>
        <li><a>Projects</a></li>
        <li><a>Contact</a></li>
    </ul>
</nav>

​
The CSS:

nav li {
    display: inline-block;
    font-size: 10px;
    height: 10px;
    margin-right: 16px;
    text-transform: uppercase;
}

.sub-menu {
    display: inline-block;
    white-space: nowrap;
}​

The JS:

$('.sub-menu').hide();

$('nav > ul > li').on({
    mouseenter: function() {
        $(this).find('ul.sub-menu').stop().animate({width: 'toggle'});
    },
    mouseleave: function(){
        $(this).find('ul.sub-menu').stop().animate({width: 'toggle'});
    }
});

The Fiddle: http://jsfiddle.net/HYPX8/

The Screenshot:

enter image description here

I have tried using just inline and the same thing occurs.

I tried using float: left on all of the li elements as well as .sub-menu but then I run in to an issue with the children li elements of .sub-menu collapsing on mouseleave

Can anyone recommend how to fix this issue? 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-15T22:45:19+00:00Added an answer on June 15, 2026 at 10:45 pm

    EDIT 0

    If you comment out $('.sub-menu').hide(); and toggle the width you see that the issues lies with how JQuery is changing the CSS because it renders out correctly on load. I’d investigate that further.

    Also, changing width to height produces something that you might want to use. See here: http://jsfiddle.net/HYPX8/5/.

    $(this).find('.sub-menu').stop().animate({height: 'toggle'});
    

    Solution Example: http://jsfiddle.net/HYPX8/2/.

    Adding the following to the .sub-menu CSS seems to prevent that drop from occurring.

    height: 10px;
    margin-right: 16px;
    

    It looks like if you really wanted to you could combine the CSS but it adds a little padding to the left.

    nav li, .sub-menu {
        display: inline-block;
        font-size: 10px;
        height: 10px;
        margin-right: 16px;
        text-transform: uppercase;
    }
    

    But, to get the desired result, all you need is the following.

    .sub-menu {
        display: inline-block;
        height: 10px;
        margin-right: 16px;
        white-space: nowrap;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty simple ASP.NET Web Form that looks a bit like the
I have simple JSF application. Everything works fine, but not navigation. It behaves like
I have a pretty simple problem. Basically I have an array called $list that
I have a pretty simple case which I started solving using foreach(), but then
Basically I do have pretty simple database that I'd like to index with Lucene.
I have a pretty simple user control that I want to bind a ScaleTransform
i have a pretty simple rectangluar WinForm that uses timers to check the end
I have a pretty simple UIViewController. It's initialized with a view I've created in
Pretty simple question, I have a webpage that is used exclusively on iPads. I've
I have a pretty simple form that I am wanting to localize (I actually

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.