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: Thu, 22 Nov 2012 12:29:29 +0100
Message-ID: <CABZS9z=4seU2t1tvm1+_9rgPVezqc4ioOOzhv+DD7=j3Rt9d3Q@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: Behrang Saeedzadeh <behrangsa@gmail.com>, W3C CSS Mailing List <www-style@w3.org>
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.

Anyway, why changing 'auto' to 0 and back can't trigger a transition? This
is changing the computed value...

On Thu, Nov 22, 2012 at 12:16 PM, Alan Gresley <alan@css-class.com> wrote:

> On 9/11/2012 11:46 AM, Behrang Saeedzadeh wrote:
>
>> Hi all,
>>
>> Any plans to add this to the CSS spec? Right now, even with JS, it is not
>> possible to do this elegantly.
>>
>> Cheers,
>> Behrang Saeedzadeh
>> http://www.behrang.org
>>
>
> Why not just use min-height?
>
> <!DOCTYPE html>
>
> <style type="text/css" media="screen">
>
> div { background: skyblue; padding: 1em;  }
>
> div:hover {
>    -webkit-transition: all 2s linear;
>     -moz-transition: all 2s linear;
>     -o-transition: all 2s linear;
>     -ms-transition: all 2s linear;
>     transition: all 2s linear;
>     min-height: 200px;
> }
>
> </style>
>
> <div>Content</div>
>
>
>
>
> --
> Alan Gresley
> http://css-3d.org/
> http://css-class.com/
>
>


-- 
Michał Z. Gołębiowski
Received on Thursday, 22 November 2012 12:48:21 GMT

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