From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/svg/attribute/keytimes/index.html | 97 +++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 files/zh-cn/web/svg/attribute/keytimes/index.html (limited to 'files/zh-cn/web/svg/attribute/keytimes/index.html') diff --git a/files/zh-cn/web/svg/attribute/keytimes/index.html b/files/zh-cn/web/svg/attribute/keytimes/index.html new file mode 100644 index 0000000000..b3aaab6aef --- /dev/null +++ b/files/zh-cn/web/svg/attribute/keytimes/index.html @@ -0,0 +1,97 @@ +--- +title: keyTimes +slug: Web/SVG/Attribute/keyTimes +tags: + - SVG + - SVG属性 + - keyTimes +translation_of: Web/SVG/Attribute/keyTimes +--- +

« SVG 属性参考主页

+ +

keyTimes属性是一个以分号分隔的时间值列表,用于控制动画的执行步骤。列表中的每个值与{{ SVGAttr("values") }}中的值一一对应,定义了{{ SVGAttr("values") }}中的值在动画中何时执行,keyTimes列表中的每一个值都是指定在[0-1]之间的浮点数,表示动画的完成时间。

+ +

如果指定了keyTimes列表,那么一定有与之完全对应的{{ SVGAttr("values") }}列表。

+ +

每一个连续的时间值必须大于等于前一个时间值。

+ +

keyTimes列表的语义取决于插值模式:

+ + + +

 

+ +

 

+ + + +

 

+ +

如果插值模式是paced(踏步),keyTimes属性被忽略。

+ +

如果duration(持续时间)不确定,则将忽略任何keyTimes规范。

+ +

用法

+ + + + + + + + + + + + + + + + + + + + +
类别动画值属性
<list>
可变性No
规范文档SVG 1.1 (2nd Edition)
+ +

示例

+ +
<?xml version="1.0"?>
+<svg width="120" height="120"
+     viewPort="0 0 120 120" version="1.1"
+     xmlns="http://www.w3.org/2000/svg">
+
+    <circle cx="60" cy="10" r="10">
+
+        <animate attributeName="cx"
+                 attributeType="XML"
+                 dur="4s"
+                 values="60 ; 110 ; 60 ; 10 ; 60"
+                 keyTimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"
+                 repeatCount="indefinite"/>
+
+        <animate attributeName="cy"
+                 attributeType="XML"
+                 dur="4s"
+                 values="10 ; 60 ; 110 ; 60 ; 10 "
+                 keyTimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"
+                 repeatCount="indefinite"/>
+
+    </circle>
+</svg>
+
+ +

元素

+ +

以下元素可以使用 keyTimes属性

+ + -- cgit v1.2.3-54-g00ecf