SVGCircleElement: cx 屬性
SVGCircleElement 介面的只讀屬性 cx 反映了 <circle> 元素的 cx 屬性,並由此定義了圓心的 x 座標。
如果未指定,則效果如同將值設定為 0。
值
一個 SVGAnimatedLength 物件,表示圓心的 x 座標。
示例
SVG
html
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
width="200"
height="200">
<circle cx="50" cy="50" r="50" fill="gold" id="circle" />
</svg>
JavaScript
js
const circle = document.getElementById("circle");
console.log(circle.cx);
規範
| 規範 |
|---|
| Scalable Vector Graphics (SVG) 2 # __svg__SVGCircleElement__cx |
瀏覽器相容性
載入中…