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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:34:22+00:00 2026-05-27T11:34:22+00:00

In a site I am managing, I have this styled link that on click

  • 0

In a site I am managing, I have this styled link that on click fades in a drop list below it, so that the user can select a genre.

I have the Fade in working perfectly, the issue I am running into is trying to determine whether or not the drop down list was hovered on so that I can hide it if the user hovers off of the styled link without entering the drop down list.

So, the drop down list Fades in, the user doesn’t enter the drop downed element, then the element fades out, however, if the user enters the drop downed element (while leaving the clicked linked that trigger the fadein) then the drop down should stay shown until leaving the drop down element.

Here is the code I have so far:

$('#categories_link').live('click mouseleave', function(e){
    $('.categories').fadeIn(200, function(){
        $(this).live('mouseenter mouseleave', function(evnt){
            switch(evnt.type) {
                case "mouseenter":
                    $(this).stop(true, true)
                    $(this).data('visible', true)
                break;

                case "mouseleave":
                    $(this).data('visible', false)
                break;
            }
        })

        if(e.type == 'mouseleave') {
            if($('.categories').data('visible'))
                return;
            else
                $('.categories').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-27T11:34:23+00:00Added an answer on May 27, 2026 at 11:34 am

    The structure is very problematic. Why do you add listeners on mouse leave?

    Best thing you could do is

    • set the fadein to appear on mouseenter
    • set fadeout on mouseleave with a ~300-400ms delay using setTimeout()
    • set the actual dropdown to fade itself in on mouseenter, using a stop before that (ie: stop(true,true).fadeIn(200), but use clearTimeout() before this happens inside the event handler.
    • set the actual dropdown to fadeout on mouseleave

    Actually you should use a stop(true,true) before all of these animations.

    The logic behind this is that if the user hovers over the dropdown, the dropdown will try to fade itself in thus cancelling the fadeout that is queued to happen (you added an extra 200-300sec timer).

    Another way to do it, is nest the dropdown inside the parent tag, so while you are hovered inside the dropdown, it won’t fade away anyway (this also works with pure css)

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

Sidebar

Related Questions

I'm managing this site: (no joke) http://www.orgasmatrix.fr/webcams As you can see, when you put
I'm currently managing multiple models from a single SITE MANAGER page. I have the
I have a site that leverages both Google Analytics and Google Maps. Both of
I have written a web service that connects to a sharepoint site. What is
For the site I'm working on, I want a user to have the ability
In an ASP.NET 3.5 site we have a relatively standard payment checkout progess that
We have a SharePoint site and we now want to only allow users that
I'm working on a fairly large site and am having trouble managing z-indexes. Is
site.com/link?p=2 give $_GET['p']==2 even though i've already made site.com/link rewrite to site.com/index.php?page=link So, i'm
My site provides a javascript that shows the rate of the Dutch equivalent of

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.