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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:40:29+00:00 2026-06-01T23:40:29+00:00

I want to create a submenu that appears when mouse over the item of

  • 0

I want to create a submenu that appears when mouse over the item of the menu. I face a problem that I want the submenu to disappear when the mouse are away from the submenu, for example the mouse move to the bottom or to the right or left side of the website.

here’s the script of my menu ,I make a sapmle of my menu in jsfiddle http://jsfiddle.net/2jUQS/1/

<div id="header">
   <ul id="menu">
    <li>
        <a href="#" class="wordsMenu">About Company</a>
    </li>
    <li>
        <a href="#" class="galaryMenu">Gallary</a>
    </li>

 </ul>
</div>
    <div id="submenus">
         <div id="galarySubMenu" class="subMenuContainer">
    <ul class="subMenuList">
        <li><a href="PhotoGallery.php">Photo Gallary</a></li>
        <li><a href="videoGallery.php">Video Gallary</a></li>
    </ul>
</div>

</div>

and here is the script

$("document").ready(function(){


  $("a.wordsMenu").bind( 'mouseover',function(){
    $("#galarySubMenu").fadeOut("fast");
  });

 $("a.galaryMenu").bind( 'mouseover',function(){


    $("#galarySubMenu").css("display","block");
    var margin_top = $("#header").height();
    var testMarginTop=parseInt($("#galarySubMenu").css("top"));
    if(testMarginTop<0){
        $("#galarySubMenu").animate({
            'top':margin_top-2
        }, {
        'duration':500,
        queue:false
    });
    }
    else{
        $("#galarySubMenu").animate({
            'top':'-300'
        },  {
        'duration':500,
        queue:false
    });
    }
});

/*
 $(".subMenuList").mouseout(function(){
      $("#galarySubMenu").fadeOut("fast");
});
*/

 });
  • 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-01T23:40:31+00:00Added an answer on June 1, 2026 at 11:40 pm

    append this to you jquery code

        $("#submenus").on('mouseleave',function(){
            $("#galarySubMenu").animate({
                    'top':'-300'
                },  {
                'duration':500,
                queue:false
            })
        })
    

    hope this helps

    I just added a handler on the whole submenus div that when mouseleaves it fades out

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

Sidebar

Related Questions

What I want is to loop the data from database and create the menu,
i want to create sub menu for a BB application when i click on
I am trying ebook reading app. In that I want create UIActionSheet by clicking
I'm trying to create a menu in VB.Net where one item in the menu
I have a navigation menu provider that I am trying to move over to
I want create listview without layout_height. I mean if there is 100 item in
I want create constructor that will take one or more integers and save it
I want to create a customized submenu where i can add an about page
I want to create a horizontal submenu in wordpress with wp_nav_menu(); As it is
I have some submenu inserted as Window item submenu of Main Menu I have

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.