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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:22:09+00:00 2026-06-11T11:22:09+00:00

I have a Nav that has a drop down sub menu. When the drop

  • 0

I have a Nav that has a drop down sub menu. When the drop down appears i would like a union of menu + drop down like this:

enter image description here

so that if the mouse exits this entire block in pink, then the sub nav disappears. Currently, if the mouse exits only the drop down, the dropdown is gone.
I saw this example but combining the class together did not work for me.

Here’s MY FIDDLE

  • 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-11T11:22:10+00:00Added an answer on June 11, 2026 at 11:22 am

    Why don’t just remove the subClass from targets of both mouseenter AND mouseleave? Like this:

    var animate;
    $(".myClass").mouseenter(function () {
      clearTimeout(animate);
      $('.myClass').css('background-color','#777');
      $('.mySubClass').css('display','inline');
    });
    $(".myClass").mouseleave(function() {
      animate = setTimeout(function(){
        $('.myClass .mySubClass').css('display','none');
        $('.myClass').css('background-color','#49616a');
      }, 800);
    });​
    

    … as .myClass covered area IS already a union of menu and drop (as the corresponding element includes both link and dropdown menu).

    I’ve fixed another potential bug here: it’s possible to sequence mouseleave-mouseenter events too fast, then timeout function will fire even though it shouldn’t (as the cursor stays in the menu area). To prevent this, an additional variable (animate) has been added; it stored the timeout in the mouseleave handler and clears it in the `mouseenter’ one.

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

Sidebar

Related Questions

I have a drop down menu in my nav bar but it has quite
I have a basic website nav layout that looks like this: <li class=folder parent_folder>
I have a nav bar that has a dropdown menu made with styled tags.
I've just build a dropdown menu which I would like to drop down on
I have a navigation menu that has submenus slide down on hover. The menu
I have a nav that has subnavs. When the user hovers over the li's
I have nav code like this in my HTML file: <div id="center_links"> <ul> <li><a
I have an app that has a tab bar & nav bar for normal
I have a UITableView that loads content into a UIWebView like this: //MainViewController.m -
I have some code that has the property display-inline . Due to this it

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.