keySplines
**keySplines** 屬性定義了一組與 keyTimes 列表關聯的 貝塞爾曲線 控制點,定義了一個控制間隔節奏的立方貝塞爾函式。
除非 calcMode 屬性設定為 spline,否則將忽略此屬性。
如果 keySplines 規範中存在任何錯誤(錯誤的值、過多或過少的值),則動畫將不會發生。
您可以將此屬性與以下 SVG 元素一起使用
示例
html
<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg">
<circle cx="60" cy="10" r="10">
<animate
attributeName="cx"
dur="4s"
calcMode="spline"
repeatCount="indefinite"
values="60; 110; 60; 10; 60"
keyTimes="0; 0.25; 0.5; 0.75; 1"
keySplines="0.5 0 0.5 1; 0.5 0 0.5 1; 0.5 0 0.5 1; 0.5 0 0.5 1" />
<animate
attributeName="cy"
dur="4s"
calcMode="spline"
repeatCount="indefinite"
values="10; 60; 110; 60; 10"
keyTimes="0; 0.25; 0.5; 0.75; 1"
keySplines="0.5 0 0.5 1; 0.5 0 0.5 1; 0.5 0 0.5 1; 0.5 0 0.5 1" />
</circle>
</svg>
使用方法說明
規範
| 規範 |
|---|
| SVG 動畫級別 2 # KeySplinesAttribute |