SVGAnimatedAngle: baseVal 屬性
SVGAnimatedAngle 介面的只讀屬性 baseVal 表示 SVG 元素上關聯的 <angle> 的基礎(非動畫)值。此屬性用於檢索 <angle> 的靜態值,不受任何正在進行的動畫影響。
此屬性反映了 SVG <marker> 元素的 orient 屬性的 <angle> 值,這與 SVGMarkerElement.orientAngle 屬性相同。
值
一個 SVGAngle 物件,表示 <angle> 內容型別的基本值。
- 該值不受動畫影響,代表角度的初始狀態。
- 角度的單位型別可以從
SVGAngle.unitType中檢索。
示例
js
const marker = document.querySelector("[orient]");
// Set the orient attribute with an angle
marker.setAttribute("orient", "90");
const baseAngle = marker.orientAngle.baseVal; // an SVGAngle object
console.log(baseAngle.value); // Output: 90
console.log(baseAngle.unitType); // Output: 1 (constant for SVG_ANGLETYPE_UNSPECIFIED)
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGAnimatedAngle__baseVal |
瀏覽器相容性
載入中…