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

Die baseVal-Eigenschaft des SVGAnimatedEnumeration-Interfaces enthält den Anfangswert einer SVG-Enumeration.

Wert

Ein Integer, der den Anfangswert der Enumeration enthält

Beispiele

Betrachten Sie dieses Snippet mit einem <clipPath>-Element: Sein clipPathUnits ist mit einem SVGAnimatedEnumeration-Objekt verknüpft.

html
<svg viewBox="0 0 100 100" width="200" height="200">
  <clipPath id="clip1" clipPathUnits="userSpaceOnUse">
    <circle cx="50" cy="50" r="35" />
  </clipPath>

  <!-- Some reference rect to materialized to clip path -->
  <rect id="r1" x="0" y="0" width="45" height="45" />
</svg>

Dieses Snippet holt das Element und protokolliert den baseVal der SVGClipPathElement.clipPathUnits-Eigenschaft.

js
const clipPathElt = document.getElementById("clip1");
console.log(clipPathElt.clipPathUnits.baseVal); // Logs 1 that correspond to userSpaceOnUse

Spezifikationen

Specification
Scalable Vector Graphics (SVG) 2
# __svg__SVGAnimatedEnumeration__baseVal

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
baseVal

Legend

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

Full support
Full support

Siehe auch