SVGAnimatedNumberList: animVal 属性
SVGAnimatedNumberList
接口的只读属性 animVal
表示可动画属性的当前动画值,该属性接受一个 <number>
值列表。
此属性反映了 <svg>
元素的 viewBox
属性、feColorMatrix
元素的 values
属性,以及 <rect>
、<polygon>
或 <polyline>
元素的 points
属性,作为一个只读的 SVGNumberList
,提供了对 points
属性定义的点的动态更新列表的访问。
值
一个 SVGNumberList
对象,表示该属性的动画值。该列表包含一个或多个数字,对应于属性中指定的各个数字值。
示例
js
const rect = document.querySelector("rect");
// Set the animatable 'points' attribute with number values
rect.setAttribute("points", "10,10 20,10 20,20 10,20");
// Access the SVGAnimatedNumberList object
const points = rect.points;
console.dir(points.animVal); // the animated state
规范
规范 |
---|
Scalable Vector Graphics (SVG) 2 # __svg__SVGAnimatedNumberList__animVal |
浏览器兼容性
加载中…