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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:30:27+00:00 2026-05-13T16:30:27+00:00

I am creating a dropdown that slides down when hovered over. This is some

  • 0

I am creating a dropdown that slides down when hovered over. This is some code that I had. I want to use HoverIntent to accomplish this goal.

.menu_img is the class on the image that is hovered over to start the slide down of the list

.page_nav is the class on the list that slides down when .menu_img is hovered over.

$(document).ready(function(){
  $('img.menu_img').click(function () {
   $('ul.page_nav').stop().slideDown('slow');
  });
});

HTML

<div id="helper_bar">
    <div class="page_width">
        <img src="images/page_nav.png" alt="page_nav" title="use this to navigate the page" class="menu_img" width="179" height="33" />
    </div>
</div>

<div class="page_width">
    <ul class="page_nav">
            <li><a href="#">About</a></li>
            <li><a href="#">Services Offered</a></li>
            <li><a href="#">The Team</a></li>
            <li><a href="#">The Process</a></li>
    </ul>
</div>

This is the code that I have. This works if you click on the img but if you switch .click to .hover it will hover out when you try to go to the li’s. This is why I brought in hoverIntent plugin but I’m not sure how to integrate it to get the proper solution I’m trying to create.

BTW i didn’t include the HTML code but its a simple image and ul li tags which I know are working fine. There is a display: none; on the ul li and I did some stuff to make it funciton properly in my layout. (i have the layout a bit different than a regular dropdown.) Either way, I’m very certain my CSS is right, I just need to figure out how to write the Jquery. Thanks!

  • 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-13T16:30:27+00:00Added an answer on May 13, 2026 at 4:30 pm

    [Updated Answer]

    What you want to do is going to be a bit challenging with a hover effect. Here is a possible solution, but you can’t use hoverIntent with it because it needs the events to bubble, and mouseenter and mouseleave events don’t bubble. However, I have incorporated a hoverIntent-like effect in this solution. First wrap both items in a single div with the id of menu:

    <div id="menu">
        <div id="helper_bar"> ... </div>
        <div class="page_width"> ... </div>
    </div>
    

    And use this JS (inside a document.ready event):

    var trigger = $("img.menu_img")[0], // The DOM element
        $nav    = $("ul.page_nav");     // The jQuery Wrapped DOM element
    $("#menu").mouseover(function(e){
       // Keep track when the mouse is over the menu area
       if(e.target == this){
         $(this).data('over', true);
       }      
    
       // Only show menu if the img.menu_img was what triggered the event
       if(e.target == trigger){
         $nav.stop().slideDown('slow');
       }
    }).mouseout(function(e){
       if( e.target == this ){
           var $this = $(this);
           $this.data('over', false);
           window.setTimeout(function(){
              if(!$this.data('over')) $nav.stop().slideUp('slow');
           }, 500); // Wait half a second to see if the mouse reenters the element
       }
    });
    

    Please ask if you have questions or problems with this solution.

    [Original Answer]

    hover will never work for what you want, since the ul list can never be a child of an img. Every time you move off the img the menu will hide. What I would recommend, is something like this (Actually, I would recommend you use image replacement instead of an image, but lets just do one thing at a time):

    HTML

    <ul id="nav">
      <li><img class="menu_img" alt="Home" />
          <ul class="page_nav">
             ...
          </ul>
      </li>
      ....
    </ul>
    

    JS

    $("#nav > li").hoverIntent( function(){
        $('ul.page_nav', this).stop().slideDown('slow');
    }, function(){
        $('ul.page_nav', this).slideUp('slow');
    });
    

    This way the mouseenter event (or a delayed version of it with hoverIntent) fires when the li is hovered, and won’t fire again until the entire list is exited by the mouse. So, as long as the mouse is over the li or any of its children, the mouseout event will never fire, allowing the page_nav to do its job as a menu.

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

Sidebar

Ask A Question

Stats

  • Questions 337k
  • Answers 337k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer container.Register(Component.For<Func<Foo>>().Instance(f)); Here's a passing unit test that demonstrates the concept:… May 14, 2026 at 3:59 am
  • Editorial Team
    Editorial Team added an answer Apparently your emacs is having a hard time saving the… May 14, 2026 at 3:59 am
  • Editorial Team
    Editorial Team added an answer The issue is whether you expect users to be able… May 14, 2026 at 3:59 am

Related Questions

I am creating a custom simple dropdown using jQuery that hides/shows a element based
I have a site that was using ASP.Net MVC Beta 5, and I have
It looks like this question was addressed here , but his solution did not
I am currently creating a type of classifieds website, and when the user enters
I am attempting to add a note capability to my CRM that I am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.