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