SVGAnimatedInteger: baseVal 属性
SVGAnimatedInteger
接口的 baseVal
属性表示可动画化的 <integer>
的基础(非动画)值。
某些属性,例如 <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 base value
console.log(animatedInteger.baseVal); // Output: 4
// Modify the base value
animatedInteger.baseVal = 6;
// Verify the reflected attribute value
console.log(feTurbulence.getAttribute("numOctaves")); // Output: "6"
规范
规范 |
---|
Scalable Vector Graphics (SVG) 2 # __svg__SVGAnimatedInteger__baseVal |
浏览器兼容性
加载中…