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 |
瀏覽器相容性
載入中…