开发者

Shouldn't css3 transitions animate between height: 100% and height: 200px?

开发者 https://www.devze.com 2023-04-10 15:57 出处:网络
css3 transitions will interpolate the state of the height o开发者_C百科f a div. Currently, chrome13 will not interpolate if you set the height with a different unit than the previous height

css3 transitions will interpolate the state of the height o开发者_C百科f a div.

Currently, chrome13 will not interpolate if you set the height with a different unit than the previous height

i.e.:

    set height to 100%
    set height to 50% (on a different rendering frame)
    height will animate correctly (assuming proper use of transition)
    set height to 100px
    height will not animate

Chrome bug? spec bug?

Illustrative jsfiddle for the motivated: http://jsfiddle.net/zDywJ/21/


I don't think this is a bug in Chrome or in the spec.

As far as I can see, CSS has no way to change a percentage into a pixel unit... so it would not have a way to compare the beginning and end in order to execute the transition.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号