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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:11:11+00:00 2026-05-24T20:11:11+00:00

Basically my client wants hidden navigation to appear when mouseover an image. I’ve solved

  • 0

Basically my client wants hidden navigation to appear when mouseover an image. I’ve solved the problem of the navigation not hiding when you mouseover the navigation and then hiding when you leave the navigation. There are two problems I’m running into and I’ve tried a variety of different combinations that I thought would work, but of course didn’t. The two problems are:

  1. When you mouseout the image without mouseover the navigation then the navigation needs to hide, as of right now it stays open until you either mouseover the image again or mouseleave the navigation.

  2. Second problem is when you mouseleave the navigation directly to mouseover the image it loops the function and hides the nav then opens the nav again, I’ve tried changing slideToggle to show, but that causes a whole bunch of other issues.

Right now the code is behaving as close to how I want it and could be considered acceptable, but I’d love to know how to solve the problems above. I thought about using the hoverIntent plugin to sense the mouse movements and only trigger the functions once the mouse has slowed, but couldn’t get it working properly. Clearly, I am a novice when it comes to javascript and jquery so please forgive me, but I’d really appreciate any help.

Here is my code

$(document).ready(function(){

$(".nav-body").hide();

$(".nav-head").mouseover(function(){
$(this).next(".nav-body").slideToggle(600);
$(".nav-body").mouseleave(function(){
$(this).hide(700);
});
});

});

Here is my html:

<p class="nav-head"><img src="/images/face-btn.jpg" /></p> 
<div class="nav-body"> 
<ul><?php wp_list_pages('title_li=&child_of=12&depth=1'); ?></ul> 
</div>
  • 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-24T20:11:11+00:00Added an answer on May 24, 2026 at 8:11 pm

    Markup change

    <div class="nav-container">
        <p class="nav-head"></p>
        <div class="nav-body"></div>
    </div>
    

    Javascript

    var eventHandler;
    
    eventHandler = function(){$(".nav-head").one("mouseover",function(){
       $(this).next(".nav-body").slideToggle(600);
        $(".nav-container").one("mouseleave", function(){
            $(this).find(".nav-body").hide(700, eventHandler);
        });
    });};
    
    eventHandler();
    

    The first change is from mouseleave to mouseout. Inside the navigation, there are likely to be descendent elements that cover the actual nav-body. With mouse leave, the handler only triggers when the mouse leaves the bound element. If it goes over descend it elements, it is considered leaving. Mouseout only triggers if it is outside the bounds of the bound object.

    The second thing I did was assign a delegate to the handler binding operation so that I could use it as a callback function for hide(). This way, the event handler won’t be restored to the nav-head until the hide is completely done.

    The last was to assign the mouseout handler to the containing div. This way, the so long as it leaves the nav-head (or the nav-body) since its contained, the body will hide.

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

Sidebar

Related Questions

Basically, I have a client that wants a breadcrumb trail implemented in the navigation
Basically, my client wants to make new visitors enter the site I'm working on
I'm currently trying to decide wether to accept a client's proposal or not. Basically,
I have a client requesting an animated/panned image be added to their website. Basically,
I am creating a 3 tier application. Basically it goes Client -> (through optional
Basically my question is the exact same one as this: Simple client/server, TCP/IP encrypting
I have a control that is basically functioning as a client-side timer countdown control.
My code basically needs to start up a simple chat server with a client.
Code for server: http://stikked.com/view/64826511 Network Code for client: http://stikked.com/view/38974838 Basically, the client connects to
Ive just built a website for a client, and Ive got an odd problem

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.