SVGAnimatedInteger: animVal-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 animVal-Eigenschaft der Schnittstelle SVGAnimatedInteger repräsentiert den animierten Wert eines <integer>. Wenn keine Animation angewendet wird, entspricht animVal baseVal.
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 aktuellen animierten Zustand des Attributs als eine Zahl.
Wert
Ein long; der animierte Wert des 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 animated value (read-only)
console.log(animatedInteger.animVal); // Output: 4 (the current animated value)
Spezifikationen
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # __svg__SVGAnimatedInteger__animVal> |
Browser-Kompatibilität
Loading…