SVGTextContentElement: lengthAdjust 属性
SVGTextContentElement
接口的只读属性 lengthAdjust
反映了给定元素的 lengthAdjust
属性。它接受该接口上定义的 LENGTHADJUST_*
常量之一。
值
一个 SVGAnimatedEnumeration
。
示例
访问 lengthAdjust 属性
html
<svg width="200" height="100">
<text id="myText" x="10" y="50" textLength="100" lengthAdjust="spacing">
Hello, SVG!
</text>
</svg>
js
const textElement = document.getElementById("myText");
// Access the `lengthAdjust` property
const lengthAdjust = textElement.lengthAdjust;
// Log the base value of the `lengthAdjust` attribute
console.log(lengthAdjust.baseVal); // Output: 1 (e.g. LENGTHADJUST_SPACING)
规范
规范 |
---|
Scalable Vector Graphics (SVG) 2 # __svg__SVGTextContentElement__lengthAdjust |
浏览器兼容性
加载中…