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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:49:26+00:00 2026-06-15T23:49:26+00:00

I have a dropmenu which is shown and hidden (slideUp and slideDown) when hovering

  • 0

I have a dropmenu which is shown and hidden (slideUp and slideDown) when hovering over an element using jquery…

$("#element").hover( function() {
    $(this).next().clearQueue();
    $(this).next().slideDown(); //animate({height:300},100);
}, function() {
    if (!$(this).next().is(':hover')) {
        $(this).next().clearQueue();
        $(this).next().slideUp(); //animate({height:0},100);
    }
});

I initially didn’t include the line clearQueue() but this caused the slideUp/Down to queue and animate for a long time if the user erratically hovers over and out of #element.

Adding that line means that the dropdown does not fully appear if the user hovers and over and out really quickly.

I can get around this by animating the slideDown but the trouble is I don’t know the exact height I need to animate to because it can change.

Is there anyway to stop this behaviour?

  • 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-06-15T23:49:27+00:00Added an answer on June 15, 2026 at 11:49 pm

    I had a similar issue with slideUp and slideDown where slideDown would give my element a static height during the animation while the element had to remain dynamically sized since it’s contents could change at any time. I fixed that by setting the CSS height value to an empty string (i.e. ”) in the animationFinished callback.

    So this should solve your problem:

    $("#element").hover(function () {
        $(this).next().stop(true).slideDown(400, function () { // .stop(true) is basically the same as .clearQueue() except that it only stops and clears animations
            $(this).css('height', '');
        }); //animate({height:300},100);
    }, function () {
        if (!$(this).next().is(':hover')) {
            $(this).next().stop(true).slideUp(); //animate({height:0},100);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this dropdown menu, when you hover over a link a dropdown
have written this little class, which generates a UUID every time an object of
Have: [DllImport(OpenAL32.dll)] static extern void alcOpenDevice(char*[] devicename); Wanna send the name to this function
I have jquery script which replaces a div when a href=#1 is selected. a
I have a jquery script which replaces a div (child1 with child2) when a
I am using the dropShadow plugin, and I have a problem with the JQuery
Have some validating problems which seem to appear only when using the Auth component.
**I currently have this jQuery drop menu working fine but I'm wanting the parent
Have a look at this code: #include <iostream> using namespace std; int main() {
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=

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.