Re: animate/transition height to/from auto

>
> On 22/11/2012 10:29 PM, Michał Gołębiowski wrote:
>
>> min-height won't work good enough because transitioning min-height
>> transitions min-height, not height. If the 'auto' element height is 100px
>> and you set min-height to 1000px, the visible part of transition
>> (min-height from 0 to 100px) will be very short.
>>
>
> I do not see the problem.


Ah, sorry, I meant max-height, not min-height. I've seen this in many
places: height set to auto and showing/hiding an element set using
max-height: 0 and max-height: SOME_LARGE_VALUEpx; Transitioning max-height
won't have a nice effect here.


>  Anyway, why changing 'auto' to 0 and back can't trigger a transition? This
>> is changing the computed value...
>>
>
> I don't quite understand what you are saying here.


I meant changing height between 0 and auto. Their computed values are 0 and
auto, respectively, so this value changes. Why can't this be handled by
transitions? What am I not seeing here?

(Obviously changing height due to added content to an element of height:
auto will exhibit a transitioning problem mentioned above, I'm not talking
about it).

-- 
Michał Z. Gołębiowski

Received on Friday, 23 November 2012 09:09:22 UTC