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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:48:27+00:00 2026-06-14T22:48:27+00:00

Imagine the following scenario: You have a menu with several items (a wordpress menu

  • 0

Imagine the following scenario: You have a menu with several items (a wordpress menu btw), and below that you would like to display a white bar with some links, but only when you hover over one particular menu item. Then, when you leave the menu item and hover over the white bar itself, which is right below the menu, it should still be there, because you want to be able to click the links inside it. The white bar should only fade out again when the mouse neither hovers over the menu item, nor over the white bar itself or any of the contained elements.

Here is what I have come up with:

$("#menu-item-62").hover(function(){ //this is the menu item
    $(".white_bar_artists").show(); //this is the white bar that shall be shown
}, function(){
    if(!$(".white_bar_artists").is(":hover")){ //the white bar should only disappear, if the user hovers neither over it nor the menu item
        $(".white_bar_artists").hide();
    }
});

So far, so good. The only problem is, the white bar only disappears again when I hover out of the menu item, not when I hover out of the white bar itself. This is why I added the following code:

$(".white_bar_artists").find("*").mouseout(function(){
    $(".white_bar_artists").hide();
    $(".white_bar").show();
});

Interestingly, even though I use find("*") to retrieve all elements inside the white bar, as soon as I hover over one of them, the white bar disappears. Still, this second bunch of code seems to be necessary to make the white bar disappear not only when hovering out of the menu item.

How can I improve either code snippet so that it meets the following two requirements:

  • The white bar stays when hovering over the menu item and the white bar itself
  • The white bar disappears when not hovering over itself, one of the contained elements, and the menu item
  • 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-14T22:48:28+00:00Added an answer on June 14, 2026 at 10:48 pm

    Bind the hover actions to the white bar too. The menu item loses hover triggering hide, but the white bar has a hover by that time triggering show.

    $("#menu-item-62, .white_bar_artists").hover(function(){
        $(".white_bar_artists").show(); //this is the white bar that shall be shown
    }, function(){
        $(".white_bar_artists").hide();
    });​
    

    I’m assuming you have the two elements displayed so the mouse can go from one to the other with no gap.

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

Sidebar

Related Questions

Imagine following scenario: We have a lot of parallel development going on in several
I have 1 unit test method that needs several parameters. I would like to
Imagine the following scenario. I have a checkbox that the user can check to
Imagine the following scenario: I am using SQL Server 2005. I have a transaction
Imagine the following scenario: I have a list of Labels stored in a table
Imagine that we have the following methods (pseudo C#): static IEnumerable<T> Iterator<T>() { switch
Imagine the following scenario: you have a set of RPG character spritesheets in PNG
Imagine the following scenario: I have two classes in a one-to-many relationship and I
Imagine the following scenario: class MyClass extends OtherClass<String>{ String myName; //Whatever } class OtherClass<T>
Imagine the following situation: I have two branches: DEV and MAIN. I'm working on

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.