SVGElement
SVG 言語における要素に直接対応する SVG DOM インタフェースのすべては、SVGElement インタフェースから派生しています。
属性
Also inherits properties from: Element, HTMLOrForeignElement
SVGElement.dataset(en-US)読取専用-
要素に付与されたカスタム・データ属性 (en-US)に対応する名前つきデータ属性の、キーと値の対のリストを与える、
DOMStringMapオブジェクトです。data-* (en-US)の形の属性を使って、これらの対を SVG で定義することもでき、ここで*は、その対のキーの名前です。これは、HTML のHTMLElement.dataset属性および HTML のdata-*グローバル属性とちょうど同様に、うまく機能します。 SVGElement.className非推奨 読取専用-
An
SVGAnimatedString(en-US) that reflects the value of theclass (en-US)attribute on the given element, or the empty string ifclassis not present. This attribute is deprecated and may be removed in a future version of this specification. Authors are advised to useElement.classListinstead. SVGElement.ownerSVGElement読取専用-
直近の先祖の
<svg>要素を参照するSVGSVGElement(en-US) です。もし、与えられた要素が最も外側の<svg>要素であれば、nullです。 SVGElement.viewportElement読取専用-
現在のビューポートを確立した
SVGElementです。多くの場合は、直近の先祖の<svg>要素です。もし、与えられた要素が最も外側の<svg>要素であれば、nullです。
メソッド
SVGElement インタフェースは、追加のメソッドを何も提供しませんが、親から、すなわち Element, HTMLOrForeignElement から、メソッドを継承しています。
イベント
Events
Listen to these events using addEventListener() or by assigning an event listener to the equivalent on... handler property defined on GlobalEventHandlers or WindowEventHandlers.
abort-
Fired when page loading is stopped before an SVG element has been allowed to load completely. Also available via the
onabortproperty. error(en-US)-
Fired when an SVG element does not load properly or when an error occurs during script execution. Also available via the
onerror(en-US) property. load(en-US)-
Fires on an
SVGElementwhen it is loaded in the browser. Also available via theonloadproperty. resize-
Fired when an SVG document is being resized. Also available via the
onresizeproperty. scroll-
Fired when an SVG document view is being shifted along the X and/or Y axes. Also available via the
onscrollproperty. unload-
Fired when the DOM implementation removes an SVG document from a window or frame. Also available via the
onunloadproperty.
仕様
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2 # InterfaceSVGElement |
ブラウザ互換性
BCD tables only load in the browser
参照
- HTML
data-*attribute - SVG
data-* (en-US)attribute - Using custom data attributes in HTML (en-US)