diff options
Diffstat (limited to 'files/zh-cn/web/api/svganimationelement')
-rw-r--r-- | files/zh-cn/web/api/svganimationelement/index.html | 96 | ||||
-rw-r--r-- | files/zh-cn/web/api/svganimationelement/targetelement/index.html | 43 |
2 files changed, 139 insertions, 0 deletions
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 +--- +<div>{{APIRef("SVG")}}</div> + +<p>The <strong><code>SVGAnimationElement</code></strong> interface is the base interface for all of the animation element interfaces: {{domxref("SVGAnimateElement")}}, {{domxref("SVGSetElement")}}, {{domxref("SVGAnimateColorElement")}}, {{domxref("SVGAnimateMotionElement")}} and {{domxref("SVGAnimateTransformElement")}}.</p> + +<p>{{InheritanceDiagram(600, 140)}}</p> + +<h2 id="Properties">Properties</h2> + +<p><em>This interface also inherits properties from its parent, {{domxref("SVGElement")}}.</em></p> + +<dl> + <dt>{{domxref("SVGAnimationElement.targetElement")}} {{ReadOnlyInline}}</dt> + <dd>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 <code>null</code>.</dd> +</dl> + +<h2 id="Methods">Methods</h2> + +<p><em>This interface also inherits methods from its parent, {{domxref("SVGElement")}}.</em></p> + +<dl> + <dt>{{domxref("SVGAnimationElement.getStartTime()")}}</dt> + <dd>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 <code>INVALID_STATE_ERR</code> is thrown.</dd> + <dt>{{domxref("SVGAnimationElement.getCurrentTime()")}}</dt> + <dd>Returns a float representing the current time in seconds relative to time zero for the given time container.</dd> + <dt>{{domxref("SVGAnimationElement.getSimpleDuration()")}}</dt> + <dd>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 <code>NOT_SUPPORTED_ERR</code> is raised.</dd> + <dt>{{domxref("SVGAnimationElement.beginElement()")}} {{experimental_inline}}</dt> + <dd>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 <code>beginElementAt(0)</code>.</dd> + <dt>{{domxref("SVGAnimationElement.beginElementAt()")}} {{experimental_inline}}</dt> + <dd> + <p>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.</p> + </dd> + <dt>{{domxref("SVGAnimationElement.endElement()")}} {{experimental_inline}}</dt> + <dd> + <p>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 <code>endElementAt(0)</code>.</p> + </dd> + <dt>{{domxref("SVGAnimationElement.endElementAt()")}} {{experimental_inline}}</dt> + <dd>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.</dd> +</dl> + +<h2 id="Events">Events</h2> + +<p>Listen to these events using <code><a href="/en-US/docs/Web/API/EventTarget/addEventListener">addEventListener()</a></code> or by assigning an event listener to the <code>on...</code> handler property of this interface.</p> + +<dl> + <dt><code><a href="/en-US/docs/Web/API/SVGAnimationElement/beginEvent_event">beginEvent</a></code></dt> + <dd>Fired when the element local timeline begins to play.<br> + Also available via the <code><a href="/en-US/docs/Web/API/SVGAnimationElement/onbegin">onbegin</a></code> property.</dd> + <dt><code><a href="/en-US/docs/Web/API/SVGAnimationElement/endEvent_event">endEvent</a></code></dt> + <dd>Fired when at the active end of the animation is reached.<br> + Also available via the <code><a href="/en-US/docs/Web/API/SVGAnimationElement/onend">onend</a></code> property.</dd> + <dt><code><a href="/en-US/docs/Web/API/SVGAnimationElement/repeatEvent_event">repeatEvent</a></code></dt> + <dd>Fired when the element's local timeline repeats. It will be fired each time the element repeats, after the first iteration.<br> + Also available via the <code><a href="/en-US/docs/Web/API/SVGAnimationElement/onrepeat">onrepeat</a></code> property.</dd> +</dl> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <td>Specification</td> + <td>Status</td> + <td>Comment</td> + </tr> + <tr> + <td>{{SpecName("SVG Animations 2", "#InterfaceSVGAnimationElement", "SVGAnimationElement")}}</td> + <td>{{Spec2("SVG Animations 2")}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName("SVG1.1", "animate.html#InterfaceSVGAnimationElement", "SVGAnimationElement")}}</td> + <td>{{Spec2("SVG1.1")}}</td> + <td>Initial definition</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("api.SVGAnimationElement")}}</p> 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 +--- +<div>{{APIRef("SVG")}}</div> + +<p><code><strong>SVGAnimationElement.targetElement</strong></code>属性是指完成动画的元素。如果没有目标元素在执行动画(例如:因为 {{SVGAttr("href")}}属性指定了一个未知的元素 ),这个值将返回<code>null</code>。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox">var <var>targetElement</var> = <var>someElement</var>.targetElement; +</pre> + +<h2 id="技术规范">技术规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <td>技术规范</td> + <td>状态</td> + <td>注释</td> + </tr> + <tr> + <td>{{SpecName("SVG Animations 2", "#__svg__SVGAnimationElement__targetElement", "SVGAnimationElement.targetElement")}}</td> + <td>{{Spec2("SVG Animations 2")}}</td> + <td> + <p>添加<code>null</code>作为没有目标元素执行动画时的返回值。</p> + </td> + </tr> + <tr> + <td>{{SpecName("SVG1.1", "animate.html#__svg__SVGAnimationElement__targetElement", "SVGAnimationElement.targetElement")}}</td> + <td>{{Spec2("SVG1.1")}}</td> + <td>初始定义</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("api.SVGAnimationElement.targetElement")}}</p> |