SVGPolylineElement: animatedPoints 属性
SVGPolylineElement 接口的只读属性 animatedPoints 反映了元素 points 属性的动画值。如果 points 属性未被动画化,它包含的值与 points 属性相同。
值
一个 SVGPointList 对象。
示例
访问 animatedPoints 属性
html
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200">
<polyline
id="myPolyline"
points="100,10 150,50 100,90 50,50"
fill="none"
stroke="blue"
stroke-width="4">
<animate
attributeName="points"
values="100,10 150,50 100,90 50,50; 150,10 200,50 150,90 100,50"
dur="2s"
repeatCount="indefinite" />
</polyline>
</svg>
js
const polylineElement = document.getElementById("myPolyline");
// Access the animatedPoints property
console.dir(polylineElement.animatedPoints); // Output: SVGPointList object
规范
| 规范 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGAnimatedPoints__animatedPoints |
浏览器兼容性
加载中…