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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:36:10+00:00 2026-05-29T22:36:10+00:00

I am building a small dropdown menu with jQuery, but i am have a

  • 0

I am building a small dropdown menu with jQuery, but i am have a small issue.
When I enter the menu it drops down, but when i want to go to the dropdown part with my mouse it will go back up(hide).
This is because the markup of the menu is a little bit different than most jQuery dropdown menus(i think).

The menu should be visible if a user hovers the a tag, but because the div tag isn’t a child of the a tag so it will fadeout if a user leave the a tag. Is there a way to fix this? I cant find any thing about this on the web.

Menu markup

     <ul>
        <li>
            <span>Some text</span>
            <a href="#"><img src="icon.png"/></a>
            <div>here comes the dropdown list</div>
        </li>
        <li>
            <span>Some text</span>
            <a href="#"><img src="icon.png"/></a>
            <div>here comes the dropdown list</div>
        </li>
        <li>
            <span>Some text</span>
            <a href="#"><img src="icon.png"/></a>
            <div>here comes the dropdown list</div>
        </li>
    </ul>

jQuery code markup

    $('a').hover(function(){                     

        $(this).next('div').fadeIn(200);

    },function(){

        $(this).next('div').fadeOut(200);

    });
  • 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-29T22:36:11+00:00Added an answer on May 29, 2026 at 10:36 pm

    The fade out shouldn’t be bound to the anchor but to the div.

    You can begin to show the div when anchor is hovered:

    $('a').on("mouseenter", function() {
      $(this).next('div').fadeIn(200);
    });
    

    Then hide the div when mouse leaves it:

    $('div').on("mouseleave", function() {
      $(this).fadeOut(200);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a small website which will have FBA enabled (SqlMembershipProvider) and I want
I am building small app that will only display products in various categories. And
Im building a small MVC system and i want my controllers to be Singletons.
I am building a small webapp for my website and have included tinyMCE as
I am building a small app which captures mouse clicks. I wrote the prototype
I'm building a small Stack Overflow application, but to collect information from Stack Overflow
I'm building a small application that will crawl sites where the content is growing
I'm currently building a small website where I write down problems that arise and
I'm building small one page application with rails 3.1 mongodb and backbonejs. I have
First, I only have experience building small-medium sized websites with php so forgive me

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.