<animate>
<animatecolor>
<animatemotion>
<animatetransform>
<discard>
<mpath>
<set>
<feBlend>
<feColorMatrix>
<feComponentTransfer>
<feComposite>
<feConvolveMatrix>
<feDiffuseLighting>
<feDisplacementMap>
<feDistantLight>
<feFlood>
<feFuncA>
<feFuncB>
<feFuncG>
<feFuncR>
<feGaussianBlur>
<feImage>
<feMerge>
<feMergeNode>
<feMorphology>
<feOffset>
<fePointLight>
<feSpecularLighting>
<feSpotLight>
<feTile>
<feTurbulence>
<filter>
<font>
<font-face>
<font-face-format>
<font-face-name>
<font-face-src>
<font-face-uri>
<foreignObject>
The SVG
<animateMotion>
element provides a way to define how an element moves along a motion path.
注意:
To reuse an existing path, it will be necessary to use an
<mpath>
element inside the
<animateMotion>
element instead of the
path
属性。
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<path fill="none" stroke="lightgrey"
d="M20,50 C20,-50 180,150 180,50 C180-50 20,150 20,50 z" />
<circle r="5" fill="red">
<animateMotion dur="10s" repeatCount="indefinite"
path="M20,50 C20,-50 180,150 180,50 C180-50 20,150 20,50 z" />
</circle>
</svg>
| 类别 | Animation element |
|---|---|
| 准许内容 |
Any number of the following elements, in any order:
Descriptive elements
<mpath>
|
keyPoints
This attribute indicate, in the range [0,1], how far is the object along the path for each
keyTimes
associated values.
Value type
:
<number>
*;
默认值
: none;
Animatable
:
no
path
This attribute defines the path of the motion, using the same syntax as the
d
属性。
Value type
:
<string>
;
默认值
: none;
Animatable
:
no
rotate
This attribute defines a rotation applied to the element animated along a path, usually to make it pointing in the direction of the animation.
Value type
:
<number>
|
auto
|
auto-reverse
;
默认值
:
0
;
Animatable
:
no
注意:
For
<animateMotion>
, the default value for the
calcMode
属性为
paced
.
begin
,
dur
,
end
,
min
,
max
,
restart
,
repeatCount
,
repeatDur
,
fill
calcMode
,
values
,
keyTimes
,
keySplines
,
from
,
to
,
by
Most notably:
attributeName
,
additive
,
accumulate
Most notably:
id
class
,
style
This element implements the
SVGAnimateMotionElement
接口。
| 规范 |
|---|
|
SVG Animations Level 2
(SVG Animations 2)
# AnimateMotionElement |
BCD tables only load in the browser
最后修改: , 由 MDN 贡献者