repeatCount
Baseline
広く利用可能
この機能は広く実装されており、多くのバージョンの端末やブラウザーで動作します。2020年1月以降、すべてのブラウザーで利用可能です。
repeatCount 属性は、アニメーションが実行される回数を示します。
この属性は、以下の SVG 要素で使用することができます。
例
html
<svg viewBox="0 0 220 150" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="100" height="100">
<animate
attributeType="XML"
attributeName="y"
from="0"
to="50"
dur="1s"
repeatCount="5" />
</rect>
<rect x="120" y="0" width="100" height="100">
<animate
attributeType="XML"
attributeName="y"
from="0"
to="50"
dur="1s"
repeatCount="indefinite" />
</rect>
</svg>
使用上のメモ
| 値 | <number> | indefinite |
|---|---|
| デフォルト値 | なし |
| アニメーション | 不可 |
<number>-
この値は反復回数を指定します。小数で部分的な反復を含むことができます。小数は単純な再生時間の部分を説明します。値は
0より大きくなければなりません。 indefinite-
この値は、アニメーションが無限に繰り返されることを示します(つまり、文書の表示が終わるまで繰り返されます)。
仕様書
| 仕様書 |
|---|
| SVG Animations Level 2> # RepeatCountAttribute> |