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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:31:11+00:00 2026-05-23T11:31:11+00:00

I have a navmenu and i use css and jquery to display or hide

  • 0

I have a navmenu and i use css and jquery to display or hide the sub-menus , What i did is when i mouseenter the button i slideDown the ul that holds the links in sub-menu and i use slideUp when i mouseout the button in navmanu , what i can not figure out it , how can i stop the slideUp action if i am hovring the links in sub-menu and activate it if my mouse is not hovering over any link in the submenu ??

    #button {
        border:2px solid #04076A;
        margin-top:50px;
        width:100px;
        padding:5px;
        text-align:center;
        background-color:#5555FF;
}

#button:hover {
                background-color:#2AAAFF;
}

#button a {
            font-family:Arial;
            text-decoration:none;
            display:block;
}

#button a:hover {
                color:#fff;
}

#DDMenu {
        width:100px;
        padding:5px;
        border:2px solid #515248;
        display:none;
}

ul {
    margin:0px;
    padding:0px;
    list-style:none;
}

ul li {
        margin:0px;
        padding:0px;
        background-color:#B8B8B0;
        opacity:.1;
}

ul li a {
        display:block;
        text-align:center;
        text-decoration:none;
}

ul li a:hover {
        background-color:#DADAD6;
}

HTML :

<div id="button">
<a href="#">Button 1</a>
</div>

<div id="DDMenu">
<ul>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
<li><a href="#">link 4</a></li>
</ul>
</div>

Jquery part :

 $(document).ready(function() {

    $('#hide').click(function(){
    $('#contents').slideToggle();
    return false; // should return false to prevent page loading
    });

    $('#button').mouseenter(function() {
    $('#DDMenu').slideDown();
    });

    $('#button').mouseleave(function() {
    $('#DDMenu').slideUp();
    });
});

Any idea please ??

  • 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-23T11:31:12+00:00Added an answer on May 23, 2026 at 11:31 am

    One of the possible solutions:

    1) create the wrapper div around the button with subMenu items like

    <div id="menu">
      // your code here
    </div>
    

    CSS:

    #menu {
        width: 100px
    }
    

    2) attach slideDown/slideUp events to that div instead of button

    $('#menu').mouseenter(function() {
      $('#DDMenu').slideDown();
    });
    
    $('#menu').mouseleave(function() {
      $('#DDMenu').slideUp();
    });
    

    Test it here: http://jsfiddle.net/KLYBJ/

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

Sidebar

Related Questions

I have a folder admin that has config.php, admin.php. I want to get navmenu.php
I have several similar links that trigger different navigation divs to appear. I am
I have an accessibility skip nav menu that uses named anchors to jump to
I have tried using CSS to set the position of the background and the
I have a horizontal nav menu that I am working on. I have one
I have this so far... <script type=text/javascript> $(document).ready(function () { $('ul').addClass('navMenu'); $('li').addClass('todo').html(<span class='navItemHead'></span>); $('span.navItemHead').wrap(<a
Have some dates in my local Oracle 11g database that are in this format:
I have a multi-level nav styled as an unordered list that looks like this:
I am observing a weird behavior in Firefox. I have a sub-nav menu item
I have an issue with a dropdown menu that is appearing too much 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.