SVG 言語における要素に直接対応する SVG DOM インタフェースのすべては、SVGElement
インタフェースから派生しています。
属性
Also inherits properties from: Element
, HTMLOrForeignElement
SVGElement.dataset
読取専用- 要素に付与されたカスタム・データ属性に対応する名前つきデータ属性の、キーと値の対のリストを与える、
DOMStringMap
オブジェクトです。data-*
の形の属性を使って、これらの対を SVG で定義することもでき、ここで*
は、その対のキーの名前です。これは、HTML のHTMLElement.dataset
属性および HTML のdata-*
グローバル属性とちょうど同様に、うまく機能します。 SVGElement.className
読取専用- An
SVGAnimatedString
that reflects the value of theclass
attribute on the given element, or the empty string ifclass
is not present. This attribute is deprecated and may be removed in a future version of this specification. Authors are advised to useElement.classList
instead. SVGElement.ownerSVGElement
読取専用- 直近の先祖の
<svg>
要素を参照するSVGSVGElement
です。もし、与えられた要素が最も外側の<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 theonabort
property. error
- Fired when an SVG element does not load properly or when an error occurs during script execution.
Also available via theonerror
property. load
- Fires on an
SVGElement
when it is loaded in the browser.
Also available via theonload
property. resize
- Fired when an SVG document is being resized.
Also available via theonresize
property. scroll
- Fired when an SVG document view is being shifted along the X and/or Y axes.
Also available via theonscroll
property. unload
- Fired when the DOM implementation removes an SVG document from a window or frame.
Also available via theonunload
property.
仕様
Specification | Status | Comment |
---|---|---|
Scalable Vector Graphics (SVG) 2 SVGElement の定義 |
勧告候補 | Adds the dataset property. |
Scalable Vector Graphics (SVG) 1.1 (Second Edition) SVGElement の定義 |
勧告 | Initial definition |
ブラウザ互換性
BCD tables only load in the browser
参照
- HTML
data-*
attribute - SVG
data-*
attribute - Using custom data attributes in HTML