blob: fdfe7c1d5da2dfd757607e53e7a510561b62cd9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
---
title: SVGGeometryElement.getPointAtLength()
slug: Web/API/SVGGeometryElement/getPointAtLength
tags:
- SVG
- getPointAtLength
translation_of: Web/API/SVGGeometryElement/getPointAtLength
---
<div>{{APIRef("SVG")}}</div>
<p><code><strong>SVGGeometryElement.getPointAtLength()</strong></code> 方法沿路径返回给定距离的点。</p>
<div class="note">
<p><strong>Note:</strong> This method was originally part of the {{domxref("SVGPathElement")}} interface. SVG 2 introduced the {{domxref("SVGGeometryElement")}} interface and moved the property to it.</p>
</div>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">DOMPoint <var>someElement</var>.getPointAtLength(float <var>distance</var>);
</pre>
<h3 id="Parameters">Parameters</h3>
<dl>
<dt>distance</dt>
<dd>A float referring to the distance along the path.</dd>
</dl>
<h3 id="Return_value">Return value</h3>
<p>A {{domxref("DOMPoint")}} indicating the point at a given distance along the path.</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName("SVG2", "types.html#__svg__SVGGeometryElement__getPointAtLength", "SVGGeometryElement.getTotalLength()")}}</td>
<td>{{Spec2("SVG2")}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.SVGGeometryElement.getPointAtLength")}}</p>
<div id="gtx-trans" style="position: absolute; left: 387px; top: 93px;">
<div class="gtx-trans-icon"></div>
</div>
|