W3C home > Mailing lists > Public > www-style@w3.org > November 2012

Re: animate/transition height to/from auto

From: Michał Gołębiowski <m.goleb@gmail.com>
Date: Fri, 23 Nov 2012 10:08:40 +0100
Message-ID: <CABZS9zn6yWkb2uH3PNraKHTwSfoTAoJC1fT4HXfG8DYO+9J95A@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: Behrang Saeedzadeh <behrangsa@gmail.com>, W3C CSS Mailing List <www-style@w3.org>
>
> 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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT