dom / latest / svganimationelement.html /

SVGAnimationElement

The SVGAnimationElement interface is the base interface for all of the animation element interfaces: SVGAnimateElement, SVGSetElement, SVGAnimateColorElement, SVGAnimateMotionElement and SVGAnimateTransformElement.

EventTarget Node Element SVGElement SVGAnimationElement

Properties

This interface also inherits properties from its parent, SVGElement.

SVGAnimationElement.requiredExtensions Read only

An SVGStringList reflecting the requiredExtensions attribute of the given element.

SVGAnimationElement.systemLanguage Read only

An SVGStringList reflecting the systemLanguage attribute of the given element.

SVGAnimationElement.targetElement Read only

An SVGElement representing the element which is being animated. If no target element is being animated (for example, because the href specifies an unknown element) the value returned is null.

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 DOMException with code INVALID_STATE_ERR is 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 DOMException with code NOT_SUPPORTED_ERR is raised.

SVGAnimationElement.beginElement() Experimental

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() Experimental

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() Experimental

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() Experimental

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

Fired when the element local timeline begins to play.

endEvent

Fired when at the active end of the animation is reached.

repeatEvent

Fired when the element's local timeline repeats. It will be fired each time the element repeats, after the first iteration.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
SVGAnimationElement
1
79
4
No
≤12.1
3
3
18
4
≤12.1
1
1.0
beginElement
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
beginElementAt
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
beginEvent_event
35
The event handler is onbegin for this event.
31
The event handler, onbegin, is not supported.
79
The event handler is onbegin for this event.
93
The event handler is onbegin for this event.
6
The event handler, onbegin, is not supported.
No
22
The event handler is onbegin for this event.
18
The event handler, onbegin, is not supported.
10
The event handler, onbegin, is not supported.
37
The event handler is onbegin for this event.
4.4.3
The event handler, onbegin, is not supported.
35
The event handler is onbegin for this event.
31
The event handler, onbegin, is not supported.
93
The event handler is onbegin for this event.
6
The event handler, onbegin, is not supported.
22
The event handler is onbegin for this event.
18
The event handler, onbegin, is not supported.
10
The event handler, onbegin, is not supported.
3.0
The event handler is onbegin for this event.
2.0
The event handler, onbegin, is not supported.
endElement
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
endElementAt
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
endEvent_event
35
The event handler is onend for this event.
31
The event handler, onend, is not supported.
79
The event handler is onend for this event.
93
The event handler is onend for this event.
6
The event handler, onend, is not supported.
No
22
The event handler is onend for this event.
18
The event handler, onend, is not supported.
10
The event handler, onend, is not supported.
37
The event handler is onend for this event.
4.4.3
The event handler, onend, is not supported.
35
The event handler is onend for this event.
31
The event handler, onend, is not supported.
93
The event handler is onend for this event.
6
The event handler, onend, is not supported.
22
The event handler is onend for this event.
18
The event handler, onend, is not supported.
10
The event handler, onend, is not supported.
3.0
The event handler is onend for this event.
2.0
The event handler, onend, is not supported.
getCurrentTime
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
getSimpleDuration
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
getStartTime
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
repeatEvent_event
35
The event handler is onrepeat for this event.
31
The event handler, onrepeat, is not supported.
79
The event handler is onrepeat for this event.
93
The event handler is onrepeat for this event.
6
The event handler, onrepeat, is not supported.
No
22
The event handler is onrepeat for this event.
18
The event handler, onrepeat, is not supported.
10
The event handler, onrepeat, is not supported.
37
The event handler is onrepeat for this event.
4.4.3
The event handler, onrepeat, is not supported.
35
The event handler is onrepeat for this event.
31
The event handler, onrepeat, is not supported.
93
The event handler is onrepeat for this event.
6
The event handler, onrepeat, is not supported.
22
The event handler is onrepeat for this event.
18
The event handler, onrepeat, is not supported.
10
The event handler, onrepeat, is not supported.
3.0
The event handler is onrepeat for this event.
2.0
The event handler, onrepeat, is not supported.
targetElement
1
79
4
No
≤12.1
4
3
18
4
≤12.1
3.2
1.0
requiredExtensions
1
79
12
No
≤12.1
3
3
18
14
≤12.1
1
1.0
systemLanguage
1
79
12
No
≤12.1
3
3
18
14
≤12.1
1
1.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimationElement