--- title: animate slug: Web/SVG/Element/animate tags: - Animação - Elemento - SVG translation_of: Web/SVG/Element/animate ---
O elemento SVG <animate>
fornece uma maneira de animar um atributo de um elemento ao longo do tempo.
html,body,svg { height:100%; margin:0; padding:0; }
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <rect width="10" height="10"> <animate attributeName="rx" values="0;5;0" dur="10s" repeatCount="indefinite" /> </rect> </svg>
{{EmbedLiveSample('Exemple', 150, '100%')}}
This element implements the {{domxref("SVGAnimateElement")}} interface.
Blinking and flashing animation can be problematic for people with cognitive concerns such as Attention Deficit Hyperactivity Disorder (ADHD). Additionally, certain kinds of motion can be a trigger for Vestibular disorders, epilepsy, and migraine and Scotopic sensitivity.
Consider providing a mechanism for pausing or disabling animation, as well as using the Reduced Motion Media Query to create a complimentary experience for users who have expressed a preference for no animated experiences.
Specification | Status | Comment |
---|---|---|
{{SpecName("SVG Animations 2", "#AnimateElement", "<animate>")}} | {{Spec2("SVG Animations 2")}} | No change |
{{SpecName("SVG1.1", "animate.html#AnimateElement", "<animate>")}} | {{Spec2("SVG1.1")}} | Initial definition |
{{Compat("svg.elements.animate")}}