Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. SVGEllipseElement

SVGEllipseElement

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

TheSVGEllipseElement interface provides access to the properties of<ellipse> elements.

EventTarget Node Element SVGElement SVGGraphicsElement SVGGeometryElement SVGEllipseElement

Instance properties

Inherits methods from its parent interface,SVGGeometryElement.

SVGEllipseElement.cxRead only

This property returns anSVGAnimatedLength reflecting thecx attribute of the given<ellipse> element.

SVGEllipseElement.cyRead only

This property returns anSVGAnimatedLength reflecting thecy attribute of the given<ellipse> element.

SVGEllipseElement.rxRead only

This property returns anSVGAnimatedLength reflecting therx attribute of the given<ellipse> element.

SVGEllipseElement.ryRead only

This property returns anSVGAnimatedLength reflecting thery attribute of the given<ellipse> element.

Instance methods

Inherits methods from its parent interface,SVGGeometryElement.

Example

SVG

html
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">  <ellipse cx="100" cy="100" rx="100" ry="60" /></svg>

JavaScript

js
const ellipse = document.getElementById("ellipse");function outputSize() {  // Outputs "horizontal radius: 100 vertical radius: 60"  console.log(    `horizontal radius: ${ellipse.rx.baseVal.valueAsString}`,    `vertical radius: ${ellipse.ry.baseVal.valueAsString}`,  );}ellipse.addEventListener("click", outputSize);

Result

Specifications

Specification
Scalable Vector Graphics (SVG) 2
# InterfaceSVGEllipseElement

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp