This page was translated from English by the community.Learn more and join the MDN Web Docs community.
repeatCount
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since январь 2020 г..
АтрибутrepeatCount указывает, сколько раз будет воспроизводиться анимация.
Этот атрибут можно использовать для следующих SVG-элементов:
In this article
Пример
html,body,svg { height: 100%;}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Это значение указывает, что анимация будет повторяться бесконечно (то есть пока документ открыт).
Спецификации
| Specification |
|---|
| SVG Animations Level 2> # RepeatCountAttribute> |