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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:26:59+00:00 2026-06-05T04:26:59+00:00

I have a menu and i am trying to show and hide the submenu

  • 0

I have a menu and i am trying to show and hide the submenu of each option. The HTML struct is the following:

<a href="/page" class="menu-option" rev="1">Option 1</a>

<ul id="submenu-1" class="submenu" style="display:none">
    <li><a href="/page">Option A</a></li>
    <li><a href="/page">Option C</a></li>
</ul>

<a href="/page" class="menu-option" rev="2">Option 2</a>

<ul id="submenu-2" class="submenu" style="display:none">
    <li><a href="/page">Option C</a></li>
    <li><a href="/page">Option D</a></li>
</ul>

In JQuery i have this code:

$(".menu-option").mouseover( function() {

    var id_option = $(this).attr("rev");

    $("#submenu-" + id_option).fadeIn("fast");

}).mouseout( function() { 

});

I don’t know what to do in the “mouseout()” event because of this:

1) If the user put the mouse in the option menu and after this put the mouse over the submenu of this option, the submenu must keep open and when the user put the mouse out of the submenu, it must be closed if the user doesn’t put the mouse back at the option menu that opened it.

2) If the user put the mouse in the option menu and after this put the mouse over other option menu, the submenu of this option must be closed.

Anybody can please help me to implement this “mouseout()” event?

  • 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-05T04:27:02+00:00Added an answer on June 5, 2026 at 4:27 am

    This should do the trick:

    Demo Here

    CSS

    .menu-container {
        float: left;
        display: block;
        width: 150px;
    }
    
    .submenu {
        display: none;
    }
    

    ​

    HTML

    <ul id="submenu-1" class="menu-container">
        <li>
            <a href="/page" class="menu-option" rev="1">Option 1</a>
            <ul class="submenu">
                <li><a href="/page">Option A</a></li>
                <li><a href="/page">Option C</a></li>
            </ul>
        </li>
    </ul>
    
    <ul id="submenu-2" class="menu-container">
        <li>
            <a href="/page" class="menu-option" rev="2">Option 2</a>
            <ul class="submenu">
                <li><a href="/page">Option C</a></li>
                <li><a href="/page">Option D</a></li>
            </ul>
        </li>
    </ul>​
    

    JS

    //Menu system
    $('.menu-container li').hover(function() {
        //show its submenu
        $('ul', this).fadeIn(100);
    
    }, function() {
        //hide its submenu
        $('ul', this).fadeOut(100);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to make the sub-menu horizontal. In my HTML it looks
I have a html/css based menu and I'm trying to put a flash video
I'm having troubles with a simple menu hide/show with jQuery. The HTML markup is
I have an action bar with a menuitem. How can I hide/show that menu
I'm new to JQuery. I'm trying to show and hide multiple divs. I have
I'm trying to make one of the MenuItems on my Menu have a checkmark
I'm trying to play on iPhone's Safari so i can have website menu bar
I have been trying to create a menu panel with jQuery that can be
I'm trying to build a menu using a UItableView with Custom cells which have
I'm trying to accomplish a simple thing. I have a 2 levels menu with

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.