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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:39:16+00:00 2026-06-17T17:39:16+00:00

I am trying to create a category menu like this . I have created

  • 0

I am trying to create a category menu like this.

I have created this so far : http://jsfiddle.net/q5GcD/

The big menu should close only if i take mouse out of bigmenu div.

Also, i am unable to position the big menu correctly so that it overlaps the small menu button.

Html :

<div id="mydiv">Menu</div>
<div id="bigmenu">This is big menu</div>

Css :

#mydiv {
    position:absolute;
    top:10px;
    left:50px;
    height:50px;
    width:200px;
    background-color:#fff;
    border:1px solid black;
}
#bigmenu {
    position:absolute;
    top:10px;
    left:50x;
    height:500px;
    width:200px;
    background-color:orangered;
}

script :

$(document).ready(function(){


    $('#bigmenu').css("display","none");
    $('#mydiv').hover(function(){
        $('#bigmenu').css("display","inline");

        },function(){
           $('#bigmenu').css("display","none");
            }

        );

});
  • 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-17T17:39:17+00:00Added an answer on June 17, 2026 at 5:39 pm

    You don’t need javascript, you can do it with CSS only using the :hover dynamic pseudo-class.

    #bigmenu should be a child of #mydiv, not a sibling, to keep it active until you go out of #bigmenu (instead of just out of #mydiv).

    You don’t need absolute position too.

    Demo: http://jsfiddle.net/q5GcD/1/

    HTML

    <div id="mydiv">
       Menu
       <div id="bigmenu">
          This is big menu
       </div>
    </div>
    

    CSS

    #mydiv {
        min-height:50px;
        width:200px;
        background-color:#fff;
        border:1px solid black;
    }
    
    #mydiv:hover > #bigmenu{
        display: block;
    }
    
    #bigmenu {  
        display: none;
        height:500px;
        width:200px;
        background-color:orangered;
    }
    

    This line:

    #mydiv:hover > #bigmenu{

    is telling the browser to apply the rule between the brackets for an element with id="bigmenu", that is child (with >, the Child Selector) of an element with id="myDiv", when you are hovering (mouse on) it.

    In the case of a sibling, like in your original HTML code, you should have used +, that is the Adjacent Sibling Selector.

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

Sidebar

Related Questions

I am trying to create a dynamic menu: a menu like those found on
I'm trying to create a sliding horizontal menu with different categories. I would like
I'm trying to create table (using migrations) with foreign key like this public function
I have menu generated by a CMS with HTML output like: <ul id=category-nav> <li>
Hi I am trying to create a dynamic menu an I seem to have
Morning, I am trying to create a count of products per category / store
(Magento Version 1.6) I'm trying to display a custom category attribute I created to
I am trying to create a dropdown menu. It working well. I want the
This should be simple, but I'm shredding my hair just trying to think how
I am trying to create an autocomplete with category option, but when i am

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.