The animate element for SVG specifies animation of a single attribute or property over time.
Specifies whether or not the animation is cumulative.
Specifies whether or not the animation is additive.
Specifies the name of the target property or attribute.
Specifies when the element should begin.
Specifies a relative offset value for the animation.
This attribute is ignored if the values attribute is specified.
Specifies the interpolation mode for the animation.
discrete | linear | paced | spline Specifies the simple duration.
<clock-value> | indefinite | media Specifies an end value for the animation that can constrain the active duration.
Specifies the animation effect when the animation is over.
Specifies the starting value of the animation.
This attribute is ignored if the values attribute is specified.
Specifies a Uniform Resource Locator (URL) reference to the element.
Specifies a unique identifier.
Specifies a set of Bézier control points associated with the keyTimes list, defining a cubic Bézier function that controls interval pacing.
This attribute is ignored unless the calcMode is set to spline .
<control-point> [; <control-point>]* ;? Specifies a semicolon-separated list of time values used to control the pacing of the animation.
Each time in the list corresponds to a value in the values attribute list, and defines when the value is used in the animation function. Each time value in the keyTimes list is specified as a floating point value between 0 and 1 (inclusive), representing a proportional offset into the simple duration of the animation element.
<number> [; <number>]* ;? Specifies the maximum value of the active duration.
Specifies the minimum value of the active duration.
Specifies a script to run when an animation element begins.
Specifies a script to run when an animation element ends.
Specifies a script to run when an animation element repeats.
Specifies the number of iterations of the animation function.
Specifies the total duration for repeat.
<clock-value> | indefinite Specifies a list of URL references which identify the required extensions, with the individual values separated by white space.
If all of the given extensions are supported by the user agent, the attribute evaluates to true. Otherwise, the current element and its children are skipped and will not be rendered.
<set-of-space-separated-tokens> Specifies whether or not the animation can restart.
always | never | whenNotActive Specifies a set of comma-separated tokens, each of which must be a Language-Tag value.
<set-of-comma-separated-tokens> Specifies whether an element is focusable, whether it is reachable using sequential focus navigation, and the relative order of the element for the purposes of sequential focus navigation.
Specifies the ending value of the animation.
This attribute is ignored if the values attribute is specified.
Specifies a sequence of values to use over the course of the animation.
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate accumulate="sum" attributeName="r" dur="1" repeatCount="3" values="0;50vh"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate additive="replace" attributeName="r" dur="1" repeatCount="indefinite" values="0;50vh"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate additive="sum" attributeName="r" dur="1" repeatCount="indefinite" values="0;50vh"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" begin="0;1;2" dur="1" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" by="50%" dur="1" repeatCount="indefinite"/>
</circle>
<circle cx="50%" cy="50%" fill="red" r="50vh">
<animate attributeName="cx" by="50%" dur="1" repeatCount="indefinite" values="50%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" calcMode="discrete" dur="3" repeatCount="indefinite" values="0;25%;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" calcMode="linear" dur="3" repeatCount="indefinite" values="0;25%;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" calcMode="paced" dur="3" repeatCount="indefinite" values="0;25%;100%"/>
</circle>
<circle cx="50%" cy="50%" fill="red" r="50vh">
<animate attributeName="cx" calcMode="paced" dur="3" keySplines="0.5 0 0.5 1; 0.5 0 0.5 1" keyTimes="0;0.5;1" repeatCount="indefinite" values="0;25%;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" calcMode="spline" dur="3" keySplines="0.5 0 0.5 1; 0.5 0 0.5 1" keyTimes="0;0.5;1" repeatCount="indefinite" values="0;25%;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="media" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" begin="0;1;2" dur="1" end="1;2;0" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" fill="freeze" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" fill="remove" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" from="0" repeatCount="indefinite" to="100%"/>
</circle>
<circle cx="50%" cy="50%" fill="red" r="50vh">
<animate attributeName="cx" dur="1" from="0" repeatCount="indefinite" to="100%" values="50%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" id="myid" r="50vh"/>
<animate attributeName="cx" dur="4" href="#myid" repeatCount="indefinite" values="0;100%"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" id="myid" repeatCount="indefinite" values="0;100%;0"/>
</circle>
<script>
var element = document.getElementById("myid");
var attribute = document.createAttribute("dur");
attribute.value = "2";
element.setAttributeNode(attribute);
</script>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" calcMode="spline" dur="2" keySplines="0.5 0 0.5 1; 0.5 0 0.5 1" keyTimes="0;0.5;1" repeatCount="indefinite" values="0;100%;0"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="2" keyTimes="0;0.75;1" repeatCount="indefinite" values="0;100%;0"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="2" max="3" repeatCount="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="2" max="media" repeatCount="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="2" min="1" repeatCount="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="2" min="media" repeatCount="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<script>
function myfunction()
{
document.querySelector("text").innerHTML = "begin";
}
</script>
<circle cx="50%" cy="50%" fill="yellow" r="50vh">
<animate attributeName="cx" dur="1" onbegin="myfunction()" repeatCount="3" values="0;100%"/>
</circle>
<text dominant-baseline="middle" text-anchor="middle" x="50%" y="50%"></text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<script>
function myfunction()
{
document.querySelector("text").innerHTML = "end";
}
</script>
<circle cx="50%" cy="50%" fill="yellow" r="50vh">
<animate attributeName="cx" dur="1" onend="myfunction()" repeatCount="3" values="0;100%"/>
</circle>
<text dominant-baseline="middle" text-anchor="middle" x="50%" y="50%"></text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<script>
let count = 0;
function myfunction()
{
document.querySelector("text").innerHTML = `repeat ${++count}`;
}
</script>
<circle cx="50%" cy="50%" fill="yellow" r="50vh">
<animate attributeName="cx" dur="1" onrepeat="myfunction()" repeatCount="3" values="0;100%"/>
</circle>
<text dominant-baseline="middle" text-anchor="middle" x="50%" y="50%"></text>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" repeatCount="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" repeatCount="3" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" repeatDur="3" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" repeatDur="indefinite" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" repeatCount="indefinite" requiredExtensions="http://www.w3.org/1999/xhtml" values="0;100%"/>
</circle>
<circle cx="50%" cy="50%" fill="red" r="50vh">
<animate attributeName="cx" dur="1" repeatCount="indefinite" requiredExtensions="http://www.w3.org/1999/xhtml http://www.w3.org/1998/Math/MathML" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" begin="0;1;2" dur="2" restart="always" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" begin="0;1;2" dur="2" restart="never" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" begin="0;1;2" dur="2" restart="whenNotActive" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" repeatCount="indefinite" systemLanguage="en-gb,en-us,en" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" fill="freeze" tabindex="4" values="0;25%"/>
</circle>
<circle cx="50%" cy="50%" fill="red" r="50vh">
<animate attributeName="cx" dur="1" fill="freeze" tabindex="3" values="0;50%"/>
</circle>
<circle cx="50%" cy="50%" fill="green" r="50vh">
<animate attributeName="cx" dur="1" fill="freeze" tabindex="2" values="0;75%"/>
</circle>
<circle cx="50%" cy="50%" fill="blue" r="50vh">
<animate attributeName="cx" dur="1" fill="freeze" tabindex="1" values="0;100%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="1" from="0" repeatCount="indefinite" to="100%"/>
</circle>
<circle cx="50%" cy="50%" fill="red" r="50vh">
<animate attributeName="cx" dur="1" from="0" repeatCount="indefinite" to="100%" values="50%"/>
</circle>
</svg>
<svg xmlns="http://www.w3.org/2000/svg">
<circle cx="50%" cy="50%" r="50vh">
<animate attributeName="cx" dur="4" repeatCount="indefinite" values="0;75%;25%;100%;0"/>
</circle>
</svg>