Note that there are some explanatory texts on larger screens.

plurals
  1. POGet auto height of an element without setting height to auto
    text
    copied!<p>I'd like to get the height of an element, if said element was currently set to <code>height:auto;</code>, without actually setting the elements height to auto. </p> <p>Pretty straight forward, but I can't figure out how to obtain the auto height value without first setting the element's height to auto. That's the part I'm trying to avoid.</p> <p>Anyone know how I would do this?</p> <hr> <p>This <a href="http://jsfiddle.net/jxS2H/" rel="nofollow">jsfiddle</a> will demonstrate my issue.</p> <p>I'm trying to set all three headings to the same height. When resize the window I need the heights to adjust. With the current script the height is first set to auto, which causes the height to jump around a bit. I'm trying to avoid this jump.</p> <hr> <p>I'll try to clarify the jump I'm referring to - When you resize the window, if the heading heights change, the animation to the new height will start. However the animation always resets to it's 'auto' height before the animation starts.</p> <p>So for example:</p> <ol> <li>Auto height = 20px</li> <li>On resize all elements animate from auto height (20px) to new height (ie - 40px)</li> <li>If resized again all elements reset to auto height (20px) THEN animate to another new height (ie - 60px)</li> </ol> <p>So if you consider step 2 to 3, my goal is to have the animation start from the current height (40px) and proceed to the new height (60px), instead of resetting to the auto height (20px) before animating to the new height (60px).</p> <p>Hopefully this helps even further...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload