<animate> - SVG: Scalable Vector Graphics 编辑

The SVG <animate> element provides a way to animate an attribute of an element over time.

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>

Attributes

Animation Attributes

Animation timing attributes
begin, dur, end, min, max, restart, repeatCount, repeatDur, fill
Animation value attributes
calcMode, values, keyTimes, keySplines, from, to, by
Other Animation attributes
Most notably: attributeName, additive, accumulate
Animation event attributes
Most notably: onbegin, onend, onrepeat

Global attributes

Core Attributes
Most notably: id
Styling Attributes
class, style
Event Attributes
Global event attributes, Document element event attributes

Usage notes

This element implements the SVGAnimateElement interface.

Accessibility concerns

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.

Specifications

SpecificationStatusComment
SVG Animations Level 2
The definition of '<animate>' in that specification.
Editor's DraftNo change
Scalable Vector Graphics (SVG) 1.1 (Second Edition)
The definition of '<animate>' in that specification.
RecommendationInitial definition

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:119 次

字数:6867

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文