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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:11:36+00:00 2026-05-29T15:11:36+00:00

Consider the following scenario: element.css({display:’none’}); element.slideDown(1000); // … // here I want to get

  • 0

Consider the following scenario:

element.css({display:'none'});
element.slideDown(1000);
// ...
// here I want to get the final height

What is the right method to get the final value of an animation before it’s finished? If I access the css properties directly I get the current values. I simplified the case above. The actual code is not bound in the same function so I can’t just create a variable to hold that value for me to refer to later.

Thanks in advance.

EDIT:

I think I couldn’t express well what I’m trying to do.
My question, revised:

element.css({display:'none'});
element.slideDown(1000);

btn.click(function() {
    var finalHeight = element..?
    var str = 'height of the element will be ' + finalHeight;
    str += ' when the animation is complete';
    alert(str);
}

Consider clicking this button before the animation is completed.

  • 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-29T15:11:36+00:00Added an answer on May 29, 2026 at 3:11 pm

    When do you need the final height? If you need the height once the animation is complete, you can easily attach a callback function as second argument to .slideDown that reads the css properties (or $(this).height()) once the animation is complete.

    If you want to predict the final height of the animation while it is still running, things are not so simple because AFAIK you can only access the computed height of elements that are already rendered by the browser, you cannot read the height of elements in future renderings. But if you hide the element before sliding it in, maybe you could attach the computed height (.height()) to the DOM-Element using .data() before you’re hiding it and then just read this value to get the final height.

    Edit:

    Actually, the things could be pretty simple: Just read the height of the element using css('height') before starting the animation (but after hiding it) and store the value using data: Look here for an example: http://jsfiddle.net/QNDcv/

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

Sidebar

Related Questions

Consider the following scenario: http://www.yourdomain.com/Default.aspx?p=2 Now we ofcourse want to check if the querystring
Consider the following scenario: http://www.restserver.com/example.php returns some content that I want to work with
Consider the following three scenarios... Scenario A @import reset.css; /* ... */ p {margin:1em
Consider the following scenario: public class Entity1 { virtual public Int32 ID { get;
Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider the following scenario . I have an array of numbers: [ 1,2,3,4 ]
Please consider the following scenario: map(T,S*) & GetMap(); //Forward decleration map(T, S*) T2pS =
Let's consider the following scenario: a function which can generate code colors from white
From couple of days i am thinking of a following scenario Consider I have
Consider this scenario: I've an XML file called person.xml with the following data in

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.