SVGAnimationElement
The SVGAnimationElement interface is the base interface for all of the animation element interfaces: SVGAnimateElement, SVGSetElement (en-US), SVGAnimateColorElement (en-US), SVGAnimateMotionElement (en-US) and SVGAnimateTransformElement (en-US).
Properties
This interface also inherits properties from its parent, SVGElement.
SVGAnimationElement.targetElement只读-
An
SVGElementrepresenting the element which is being animated. If no target element is being animated (for example, because thehref (en-US)specifies an unknown element) the value returned isnull.
Methods
This interface also inherits methods from its parent, SVGElement.
SVGAnimationElement.getStartTime()-
Returns a float representing the begin time, in seconds, for this animation element's current interval, if it exists, regardless of whether the interval has begun yet. If there is no current interval, then a
DOMExceptionwith codeINVALID_STATE_ERRis thrown. SVGAnimationElement.getCurrentTime()-
Returns a float representing the current time in seconds relative to time zero for the given time container.
SVGAnimationElement.getSimpleDuration()-
Returns a float representing the number of seconds for the simple duration for this animation. If the simple duration is undefined (e.g., the end time is indefinite), then a
DOMExceptionwith codeNOT_SUPPORTED_ERRis raised. SVGAnimationElement.beginElement()实验性-
Creates a begin instance time for the current time. The new instance time is added to the begin instance times list. The behavior of this method is equivalent to
beginElementAt(0). SVGAnimationElement.beginElementAt()实验性-
Creates a begin instance time for the current time plus the specified offset. The new instance time is added to the begin instance times list.
SVGAnimationElement.endElement()实验性-
Creates an end instance time for the current time. The new instance time is added to the end instance times list. The behavior of this method is equivalent to
endElementAt(0). SVGAnimationElement.endElementAt()实验性-
Creates a end instance time for the current time plus the specified offset. The new instance time is added to the end instance times list.
Events
Listen to these events using addEventListener() or by assigning an event listener to the on... handler property of this interface.
beginEvent(en-US)-
Fired when the element local timeline begins to play. Also available via the
onbegin(en-US) property. endEvent(en-US)-
Fired when at the active end of the animation is reached. Also available via the
onend(en-US) property. repeatEvent(en-US)-
Fired when the element's local timeline repeats. It will be fired each time the element repeats, after the first iteration. Also available via the
onrepeat(en-US) property.
Specifications
| Specification |
|---|
| SVG Animations Level 2 # InterfaceSVGAnimationElement |
Browser compatibility
BCD tables only load in the browser