Animate an element with a variable height