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 |
浏览器兼容性
加载中…