SVGElement
SVG 言語における要素に直接対応する SVG DOM インタフェースのすべては、SVGElement
インタフェースから派生しています。
属性
Also inherits properties from: Element
, HTMLOrForeignElement
。
SVGElement.dataset
読取専用-
要素に付与されたカスタム・データ属性 (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 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
(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
onabort
property. 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
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 the
onresize
property. scroll
-
Fired when an SVG document view is being shifted along the X and/or Y axes. Also available via the
onscroll
property. unload
-
Fired when the DOM implementation removes an SVG document from a window or frame. Also available via the
onunload
property.
仕様
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)