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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:45:05+00:00 2026-05-17T21:45:05+00:00

I want to make a dropdown menu using jquery, but it closes even it

  • 0

I want to make a dropdown menu using jquery, but it closes even it shouldn’t.

I have an element which is subscribed to the mouseenter event, mouse enters the element, the dropdown, fires up, everything seems to be ok. I go down to the item list which is list element with some content in it. The first time i change the two elements everything works as is expected. So i leave the elements the mouseout event is called and within 1000 ms the list isn’t visible anymore.
The second time i open the “dropdown” it seems to be ok, but if i go over the list, it disappears like it should when i leave the elements. Some way its logical because every of the two elements (button and list) are subscribed to two events: mouseenter and mouseleave. Mouseenter provides a clearInterval, mouseout provides a setInterval. Data is stored in a variable called tTimer which has a default value from 0.
I really dont know why this happens. heres a snipplet from my code:

        var tTimer = 0;
        var rmItemList = function(){itemList.remove(); clearTimeout(tTimer); }

        $(this).bind("mouseleave",function(){ tTimer = window.setTimeout(rmItemList, 1000); });
        itemList.bind("mouseleave",function(){ tTimer = window.setTimeout(rmItemList, 1000); });
        $(this).bind("mouseenter",function(){ window.clearTimeout(tTimer); itemList.appendTo("body"); });
        itemList.bind("mouseenter",function(){ window.clearTimeout(tTimer); });
  • 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-17T21:45:05+00:00Added an answer on May 17, 2026 at 9:45 pm

    I’m finding it a little tricky to visualise what you’re doing. I see, however, that you are repeatedly adding and removing an element from the DOM. I believe that .remove() removes event handlers from the element. It might well be better to use .show() and .hide() instead.

    This would have the additional advantage of much improved performance.

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

Sidebar

Related Questions

I want to make a dropdown menu for my website with jquery... a couple
I want to make a dropdown menu like delicious has at this http://delicious.com/search?context=all&p=sql&lc=1 page.
I have a little dropdown menu similar <select> , which contolled from external js-function.
I want to make an entity that has an autogenerated primary key, but also
I want to make sure that a set of functions have the same signature
I want to make a login system using ASP.NET (MVC). On the internet, I
I have the following html in my ASP.NET form. It represents a dropdown menu
I have a shopping cart that displays product options in a dropdown menu and
I am trying to make the drop down menu lists display inline(horizontally) but end
i have a dropdown list and text box. i disabled both controls using code

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.