From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/svganimationelement/index.html | 96 ++++++++++++++++++++++ .../svganimationelement/targetelement/index.html | 43 ++++++++++ 2 files changed, 139 insertions(+) create mode 100644 files/zh-cn/web/api/svganimationelement/index.html create mode 100644 files/zh-cn/web/api/svganimationelement/targetelement/index.html (limited to 'files/zh-cn/web/api/svganimationelement') diff --git a/files/zh-cn/web/api/svganimationelement/index.html b/files/zh-cn/web/api/svganimationelement/index.html new file mode 100644 index 0000000000..6444e9167d --- /dev/null +++ b/files/zh-cn/web/api/svganimationelement/index.html @@ -0,0 +1,96 @@ +--- +title: SVGAnimationElement +slug: Web/API/SVGAnimationElement +tags: + - API + - NeedsExample + - NeedsTranslation + - Reference + - SVG + - SVG DOM + - TopicStub +translation_of: Web/API/SVGAnimationElement +--- +
{{APIRef("SVG")}}
+ +

The SVGAnimationElement interface is the base interface for all of the animation element interfaces: {{domxref("SVGAnimateElement")}}, {{domxref("SVGSetElement")}}, {{domxref("SVGAnimateColorElement")}}, {{domxref("SVGAnimateMotionElement")}} and {{domxref("SVGAnimateTransformElement")}}.

+ +

{{InheritanceDiagram(600, 140)}}

+ +

Properties

+ +

This interface also inherits properties from its parent, {{domxref("SVGElement")}}.

+ +
+
{{domxref("SVGAnimationElement.targetElement")}} {{ReadOnlyInline}}
+
An {{domxref("SVGElement")}} representing the element which is being animated. If no target element is being animated (for example, because the {{SVGAttr("href")}} specifies an unknown element) the value returned is null.
+
+ +

Methods

+ +

This interface also inherits methods from its parent, {{domxref("SVGElement")}}.

+ +
+
{{domxref("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 {{domxref("DOMException")}} with code INVALID_STATE_ERR is thrown.
+
{{domxref("SVGAnimationElement.getCurrentTime()")}}
+
Returns a float representing the current time in seconds relative to time zero for the given time container.
+
{{domxref("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 {{domxref("DOMException")}} with code NOT_SUPPORTED_ERR is raised.
+
{{domxref("SVGAnimationElement.beginElement()")}} {{experimental_inline}}
+
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).
+
{{domxref("SVGAnimationElement.beginElementAt()")}} {{experimental_inline}}
+
+

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.

+
+
{{domxref("SVGAnimationElement.endElement()")}} {{experimental_inline}}
+
+

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).

+
+
{{domxref("SVGAnimationElement.endElementAt()")}} {{experimental_inline}}
+
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.
+ Also available via the onbegin property.
+
endEvent
+
Fired when at the active end of the animation is reached.
+ Also available via the onend property.
+
repeatEvent
+
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 property.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("SVG Animations 2", "#InterfaceSVGAnimationElement", "SVGAnimationElement")}}{{Spec2("SVG Animations 2")}} 
{{SpecName("SVG1.1", "animate.html#InterfaceSVGAnimationElement", "SVGAnimationElement")}}{{Spec2("SVG1.1")}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("api.SVGAnimationElement")}}

diff --git a/files/zh-cn/web/api/svganimationelement/targetelement/index.html b/files/zh-cn/web/api/svganimationelement/targetelement/index.html new file mode 100644 index 0000000000..fd722f4005 --- /dev/null +++ b/files/zh-cn/web/api/svganimationelement/targetelement/index.html @@ -0,0 +1,43 @@ +--- +title: targetElement +slug: Web/API/SVGAnimationElement/targetElement +translation_of: Web/API/SVGAnimationElement/targetElement +--- +
{{APIRef("SVG")}}
+ +

SVGAnimationElement.targetElement属性是指完成动画的元素。如果没有目标元素在执行动画(例如:因为 {{SVGAttr("href")}}属性指定了一个未知的元素 ),这个值将返回null

+ +

语法

+ +
var targetElement = someElement.targetElement;
+
+ +

技术规范

+ + + + + + + + + + + + + + + + + + + +
技术规范状态注释
{{SpecName("SVG Animations 2", "#__svg__SVGAnimationElement__targetElement", "SVGAnimationElement.targetElement")}}{{Spec2("SVG Animations 2")}} +

添加null作为没有目标元素执行动画时的返回值。

+
{{SpecName("SVG1.1", "animate.html#__svg__SVGAnimationElement__targetElement", "SVGAnimationElement.targetElement")}}{{Spec2("SVG1.1")}}初始定义
+ +

浏览器兼容性

+ + + +

{{Compat("api.SVGAnimationElement.targetElement")}}

-- cgit v1.2.3-54-g00ecf