SVGAnimatedInteger: animVal 属性
接口的 SVGAnimatedIntegeranimVal 属性表示一个 <integer> 的动画值。如果没有应用动画,animVal 等于 baseVal。
某些属性,例如 <feTurbulence> 元素的 numOctaves 属性或 <feConvolveMatrix> 元素的 order 属性,接受一个 long 整数作为值。此属性提供了对属性当前动画状态的数字访问。
值
一个 long;该属性的动画值。
示例
js
const feTurbulence = document.querySelector("feTurbulence");
// Set the animatable 'numOctaves' attribute
feTurbulence.setAttribute("numOctaves", "4");
// Access the SVGAnimatedInteger object
const animatedInteger = feTurbulence.numOctaves;
// Get the animated value (read-only)
console.log(animatedInteger.animVal); // Output: 4 (the current animated value)
规范
| 规范 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGAnimatedInteger__animVal |
浏览器兼容性
加载中…