SVGAnimatedEnumeration
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
SVGAnimatedEnumeration
インターフェイスは、特定の列挙型にある定数における、アニメーション可能な属性値を記述します。
インスタンスプロパティ
インスタンスメソッド
SVGAnimatedEnumeration
インターフェイスは、固有のメソッドを指定していません。
値
<clipPath>
要素によるこのコードがあったとします。 clipPathUnits
は SVGAnimatedEnumeration
オブジェクトに関連付けられています。
html
<svg viewBox="0 0 100 100" width="200" height="200">
<clipPath id="clip1" clipPathUnits="userSpaceOnUse">
<circle cx="50" cy="50" r="35" />
</clipPath>
<!-- クリップパスに素材化された参照長方形 -->
<rect id="r1" x="0" y="0" width="45" height="45" />
</svg>
このスニペットは要素を取得し、 SVGClipPathElement.clipPathUnits
プロパティの baseVal
と animVal
をログ出力します。アニメーションが現れないため、両者の値は同じです。
js
const clipPathElt = document.getElementById("clip1");
console.log(clipPathElt.clipPathUnits.baseVal); // userSpaceOnUse に対応する 1 をログ出力
console.log(clipPathElt.clipPathUnits.animVal); // userSpaceOnUse に対応する 1 をログ出力
仕様書
Specification |
---|
Scalable Vector Graphics (SVG) 2> # InterfaceSVGAnimatedEnumeration> |
ブラウザーの互換性
Loading…