From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/svgelement/index.html | 144 ++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 files/zh-cn/web/api/svgelement/index.html (limited to 'files/zh-cn/web/api/svgelement/index.html') diff --git a/files/zh-cn/web/api/svgelement/index.html b/files/zh-cn/web/api/svgelement/index.html new file mode 100644 index 0000000000..1ee9eaa4d4 --- /dev/null +++ b/files/zh-cn/web/api/svgelement/index.html @@ -0,0 +1,144 @@ +--- +title: SVGElement +slug: Web/API/SVGElement +translation_of: Web/API/SVGElement +--- +
{{APIRef("SVG")}}
+ +
所有SVG DOM类的父类.
+ +
 
+ +

{{InheritanceDiagram}}

+ +

属性

+ +
+
{{domxref("SVGElement.dataset")}}{{readonlyInline}}
+
A {{domxref("DOMStringMap")}} object which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element. These can also be defined in SVG using attributes of the form {{SVGAttr("data-*")}}, where * is the key name for the pair. This works just like HTML's {{domxref("HTMLElement.dataset")}} property and HTML's {{htmlattrxref("data-*")}} global attribute.
+
{{domxref("SVGElement.id")}}{{readonlyInline}}
+
A {{domxref("DOMString")}} representing the value of the {{SVGAttr("id")}} attribute on the given element, or the empty string if id is not present.
+
{{domxref("SVGElement.xmlbase")}}{{readonlyInline}}
+
A {{domxref("DOMString")}} corresponding to the {{SVGAttr("xml:base")}} attribute on the given element.
+
{{domxref("SVGElement.ownerSVGElement")}}{{readonlyInline}}
+
An {{domxref("SVGSVGElement")}} referring to the nearest ancestor {{SVGElement("svg")}} element. null if the given element is the outermost <svg> element.
+
{{domxref("SVGElement.viewportElement")}}{{readonlyInline}}
+
The {{domxref("SVGElement")}}, which established the current viewport. Often, the nearest ancestor {{SVGElement("svg")}} element. null if the given element is the outermost <svg> element.
+
+ +

方法

+ +

SVGElement类本身没有方法, 但拥有从父类{{domxref("Element")}}继承的方法.

+ +

规范

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("SVG2", "types.html#InterfaceSVGElement", "SVGElement")}}{{Spec2("SVG2")}}Adds the {{domxref("SVGElement.dataset", "dataset")}} property.
{{SpecName("SVG1.1", "types.html#InterfaceSVGElement", "SVGElement")}}{{Spec2("SVG1.1")}}Initial definition
+ +

浏览器兼容性

+ +

{{ CompatibilityTable }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Microsoft EdgeInternet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatIE("9.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
dataset attribute{{CompatChrome("54")}}{{CompatUnknown}}{{CompatGeckoDesktop("51")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatOpera("41")}}{{CompatSafari("10.0")}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatNo}}{{CompatVersionUnknown}}[1]{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}} [1]
dataset attribute{{CompatNo}}54{{CompatUnknown}}{{CompatGeckoMobile(51)}}{{CompatUnknown}}4110.054
+
+ +

[1] 属性 offsetParent, offsetTop, offsetLeft, offsetWidth, 和 offsetHeight 从Chrome 48开始被废弃.

+ +

相关链接

+ + -- cgit v1.2.3-54-g00ecf