dur

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

We’d love to hear your thoughts on the next set of proposals for the JavaScript language. You can find a description of the proposals here.
Please take two minutes to fill out our short survey.

该属性标识了动画的简单持续时间。

使用说明

类别 动画定时属性
<clock-value> | indefinite
可变性 No
<clock-value>

指定简单持续时间的时长。值必须大于 0。可以用小时(h)、分钟(m)、秒(s)、毫秒(ms)表达这个值。可以组合这些时间表达式以提供一个复合的持续时间,比如这样:hh:mm:ss.iii 或者这样:mm:ss.iii

如果一个动画元素不带有dur属性,简单持续时间就是无限期的。请注意:如果一个简单持续时间是无限期的,则插值不能起作用(虽然它对 <set> 元素依然是有用的)。

示例

元素

下列元素可以使用dur属性:

规范

Specification
SVG Animations Level 2
# DurAttribute