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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:10:14+00:00 2026-05-23T01:10:14+00:00

I a have a menu, which on rollover shows a div which is not

  • 0

I a have a menu, which on rollover shows a div which is not a child of the menu and when you roll off it hides that div again. The div is placed directly below the menu item, mimicking a submenu.

the html looks something like this –

Here is my menu –

<div id="nav">
<ul>
    <li class='with_panel'>
      <span id='panel1' class='current'><img src='theImage' /></span>
    </li>
    <!-- more list items -->
</ul>
</div>

In an unrelated div, I have this –

<div id="panels">
     <div style="" id="panel1_panel" class="panel">
        <img src="myImage.png">
     </div>
<div>

I have some jquery that shows and hides the related panel when you rollover the li –

$("#nav .with_panel").mouseenter(function(){
    var id = $(this).find("span").attr("id");
    $(".panel").removeClass("open");
    $panel = $("#" + id + "_panel");
    $panel.addClass("open");
    $img = $(this).find("span img");
    $img.addClass("on");
    var hide = function(){
    if(!$panel.is(":hover")){
            $img.removeClass("on");
            $panel.removeClass("open");
        }
    }

    $panel.mouseleave(hide);
    $(this).mouseleave(hide);   
})

This only seems to work in Chrome, and I’m fairly certain it’s due to ie & Firefox not recognising .is(“:hover”).

I can’t change the html structure, only the javascript. So I’m struggling on getting it to work cross browser. Any ideas?

  • 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-05-23T01:10:14+00:00Added an answer on May 23, 2026 at 1:10 am

    The following code gives you 200 ms timeout (hide_to) to leave the menu and enter your panel before hiding it. Works the other way too. If you mouseenter the menuitem or the panel the timeout for the hiding is cancelled, and restarted when the mouse leaves any of them.

    $("#nav .with_panel").each(function() {
        var id = $(this).find("span").attr("id"),
            $panel = $("#" + id + "_panel"),
            $img = $(this).find("span img"),
            hide_to = null;
    
        var hide = function() {
                // start hide timeout
                hide_to = window.setTimeout(function () {
                    $img.removeClass("on");
                    $panel.removeClass("open");
                },200);
            };
    
        var show = function() {
                // clear hide timeout
                window.clearTimeout(hide_to);
                if (!$panel.is(".open"))
                {
                    // open panel, only if it is not open already
                    $(".panel").removeClass("open");
                    $panel.addClass("open");
                    $img.addClass("on");
                }
            };
    
        $(this).mouseenter(function() {
            show();
        }).mouseleave(function() {
            hide();
        });
    
        $panel.mouseenter(function() {
            show();
        }).mouseleave(function() {
            hide();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a menu div which has a dark background. Inside it, I have
I have a menu running off of a sitemap which one of the SiteMapNode
Hi Have a menu which look like this <div id=products_menu class=span-9 last> <ul> <li><a
have a menu item which displays a modal div. wish the created div to
I have dropdown menu..which is dynamic.. How can get value of the last item
I have a asp:menu object which I set up to use a SiteMapDataSource but
There are lots of java apps on my simulator menu screen which I have
I have a vertical menu in my system which is basically made of HTML
I have a web system which has a classical parent-children menu saved in a
I have a form which is a mdicontainer and has a menu strip at

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.