Re: animate/transition height to/from auto

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 UTC