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 January 2020.

Die animVal-Eigenschaft der Schnittstelle SVGAnimatedInteger repräsentiert den animierten Wert eines <integer>. Falls keine Animation angewendet wird, entspricht animVal dem 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 den Zugriff auf den aktuellen animierten Zustand des Attributs als 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

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
animVal

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch