SVGAnimatedInteger: baseVal-Eigenschaft
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
Die baseVal-Eigenschaft der SVGAnimatedInteger-Schnittstelle repräsentiert den Basiswert (nicht animiert) eines animierbaren <integer>.
Einige Attribute, wie das numOctaves-Attribut des <feTurbulence>-Elements oder das order-Attribut des <feConvolveMatrix>-Elements, akzeptieren einen long Integer als Wert. Diese Eigenschaft bietet Zugriff auf den statischen, nicht animierten Zustand des Attributs als Zahl.
Wert
Ein long; der Basiswert (nicht animiert) des reflektierten Attributs.
Beispiele
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"
Spezifikationen
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # __svg__SVGAnimatedInteger__baseVal> |
Browser-Kompatibilität
Loading…