且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CSS3过渡在Chrome中不再工作

更新时间:2023-10-27 23:07:16

您的问题是, undefined属性:您正在将更改为 239px ,但不要显式指定为 0 。因此,它默认为 auto ,该值没有到 239px 的有效平滑过渡。

Your problem is that you are trying to animate from an undefined property: you are changing left to 239px, but don't explicitly specify it as 0 initially. It therefore defaults to auto, a value for which there is no valid smooth transition to 239px.

向基本定义中添加 left:0 即可。

Add left:0 to the base definition and you will be fine.

请参阅这里的JSfiddle演示您在Chrome 32+中的问题