SVGCircleElement: cy 屬性

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2015 年 7 月⁩以來,各瀏覽器均已提供此特性。

SVGCircleElement 介面的只讀屬性 cy 反映了 <circle> 元素的 cy 屬性,從而定義了圓心的 y 座標。

如果未指定,則效果如同將值設定為 0

一個 SVGAnimatedLength 物件,表示圓心的 y 座標。

示例

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.cy);

規範

規範
Scalable Vector Graphics (SVG) 2
# __svg__SVGCircleElement__cy

瀏覽器相容性

另見