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

  • Home
  • SEARCH
  • 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 4626902
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:29:19+00:00 2026-05-22T03:29:19+00:00

I have created a drop-down-menu, the html for the drop-down part basically looks like

  • 0

I have created a drop-down-menu, the html for the drop-down part basically looks like this:

<div class="menu-item">
  <!-- Menu title -->
  <div class="drop-down">
    <!-- Content -->
  </div>
</div>

I want to animate this using jQuery-Code (with the easing-plugin), but the following Code does not work:

$(".menu-item").mouseenter(activate);
$(".menu-item").mouseleave(deactivate);

function deactivate()
{
  var dropdown = $(this).find("div.drop-down");
  dropdown.stop().animate(
    {height:     '0px'},
    {queue:       false,
     duration:    600,
     easing:      'easeOut'
    }
  );
}

function activate()
{
  var dropdown = $(this).find("div.drop-down");
  dropdown.stop().animate(
    {height:     'auto'},
    {queue:       false,
     duration:    600,
     easing:      'easeOut'
    }
  );
}

The message in the error console is: “Warning: Error in parsing value for ‘height’. Declaration dropped.”

If I use “height: ‘100px'” or somthing similar in the activate-Function it works as expected. But for maintainability reasons i want the height to be calculated autmatically, so the drop-down adapts its size to its content.

How can this be achieved?

Greetings,
Jost

  • 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-22T03:29:20+00:00Added an answer on May 22, 2026 at 3:29 am

    I would try to use slideUp() and slideDown() for this animation. Note that those functions accept easing functions.

    Other option, if for some reason you need to use animate for this, you might want to do something like this in your activate function:

    function activate(){
      var dropdown = $(this).find("div.drop-down");
    
      dropdown.css('height','auto')
              .hide()
              .stop()
              .animate(
                 {height:     'auto'},
                 {queue:       false,
                  duration:    600,
                  easing:      'easeOut'
              });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, basically I have this select / drop down menu that I use AJAX
like the title says, I am trying to create a drop down menu using
I have created a drop down menu with animals. But what I wanna do
I have created a simple drop down menu, with functions in it. And then
I have created this css3 dropdown menu that appears behind the image when I
I basically need to create a value by default for a drop down menu
I would like to create a drop down menu on top of my google
I have created a C# class file by using a XSD-file as an input.
i have created a workflow activity that do give the item creater of a
I'm trying to insert a drop down menu values to a table named units

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.