Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Using mouseout to close drop-down menu not working properly

Posted on 2013-05-17
Medium Priority
Last Modified: 2013-05-17
My test page:

Mouseover the "make contact" text at the top-right, and a menu appears below it. That works fine.

I'm trying to create a smooth, usable mouseout effect. I thought if the user mouses away from the menu, it should close (the actual menu, not the menu's opener "make contact"). This is what I have:


However, if you mouseover the "EMAIL" link, that apparently counts as a "mouse out" of the <div> that contains it, and the menu closes prematurely. My markup looks like this:

<a id="contactbtn">MAKE CONTACT</a>
<div id="contact">
      <div class="blackline"></div>
      <a href="mailto:info@partnersdesign.net">EMAIL</a>
      <div class="blackline"></div>
      <a href="https://www.facebook.com/pages/Partners-Design-Inc/62221992069?fref=ts" target="_blank">FACEBOOK</a>

Is there a better way to handle the mouseout so it works more smoothly?

Thank you!
Question by:bbdesign
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 27

Expert Comment

ID: 39175515
you need to apply cancelBubble() to the event that fires in your a tag

Author Comment

ID: 39175555
I'm not following you. How do I modify my script to make the menu slide up at the right time?

LVL 27

Accepted Solution

skullnobrains earned 2000 total points
ID: 39175661
whatever the problem was, i cannot reproduce it with FF 21 on linux not FF(?) ON BSD nor FF(?) on windows XP

but but the problem should be related with an onmouseover event of the internal A tag rather that whatever problem related to the onmouseout of the DIV

Author Comment

ID: 39175703
I ended up doing this:

      if ($('#contact').is(':hover')===false && $('#contacthover1').is(':hover')===false && $('#contacthover2').is(':hover')===false){

So now it just checks each element individually to make sure it isn't in a mouseover state... if none are moused over, then it closes the menu.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question