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 |
瀏覽器相容性
載入中…