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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:48:25+00:00 2026-05-29T05:48:25+00:00

I have decided to use floating div’s for my drop down menu because i

  • 0

I have decided to use floating div’s for my drop down menu because i can apply a shadow and rounded corners.

i have the following list item:

<li class="navDrop" id="navEvents"><a href="#">Events</a></li>

And the following div that corresponds to the menu item:

<div class="navSub" id="navEventsDrop"> Events </div>

I am currently using the following script to handle the show/hide of the elements (note that ive made it apply the handlers to a class, which links the li and corresponding div’s ids):

<script type="text/javascript">
$(".navDrop").mouseenter(
  function () {
    $('#'+this.id+'Drop').css({
          position:'absolute',
          top: $(this).offset().top + $(this).height() + 'px',
          left: $(this).offset().left + 'px',
          zIndex:1000
    }).show();
});

$(".navDrop").mouseleave(
  function () {
    $('#'+this.id+'Drop').hide();
});
</script>

My problem is that once the cursor has left the li, the div disappears, regardless if the cursor is over the div still.

I just cant figure a solution to this other than placing the div inside of the .navDrop class. But i tried doing that, and it just positions the div weirdly.

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-29T05:48:26+00:00Added an answer on May 29, 2026 at 5:48 am

    Try wrapping each element

    <div class="navItem">
      <li class="navTitle" id="navEvents"><a href="#">Events</a></li>
      <div class="navContent" id="navEventsDrop" style="display:none"> Events </div>
    </div>
    

    Then the jQuery:

    $('.navItem').mouseenter(function() {
       $(this).children('.navContent').show();
    })
    
    $('.navItem').mouseleave(function() {
       $(this).children('.navContent').hide();
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started a new web application and have decided to use jquery as
I have setup subversion 1.6.5 on Fedora. I have decided to use a single
I'm writing a web application (PHP) for my friend and have decided to use
I've been developing a site using ASP.NET MVC, and have decided to use the
I have some complex types here so I decided to use nifty trick to
I have to use windows to write some shell scripts. I decided to use
I have decided to use SubSonic (v3.0) for the first time and thoroughly enjoy
I have decided to use ASP.NET MVC to develop multi page (registration) forms in
So I have decided to use XDocument to create a XML file, which was
I am writing a small plugin architecture and I have decided to use MEF

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.