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/mathml/element/maction/index.html | 235 ++++++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 files/zh-cn/web/mathml/element/maction/index.html (limited to 'files/zh-cn/web/mathml/element/maction') diff --git a/files/zh-cn/web/mathml/element/maction/index.html b/files/zh-cn/web/mathml/element/maction/index.html new file mode 100644 index 0000000000..3715f500ec --- /dev/null +++ b/files/zh-cn/web/mathml/element/maction/index.html @@ -0,0 +1,235 @@ +--- +title: +slug: Web/MathML/Element/maction +translation_of: Web/MathML/Element/maction +--- +
{{MathMLRef}}
+ +
+

MathML<maction>元素提供了一种让表达式(或子表达式)具有某种特定行为的可能性。具体行为方式由actiontype属性的取值来确定。也可以使用selection属性来手动指定该行为作用在哪个子元素上。

+
+ +

属性

+ +
+
actiontype
+
该属性描述元素上发生了哪种行为,有如下几种取值: +
    +
  • statusline: 当元素被点击或屏幕阅读器的指针指向该元素时触发,message会在浏览器的状态栏中显示。语法如下:<maction actiontype="statusline"> expression message </maction>
  • +
  • toggle: 当子表达式被点击时触发,子表达式会依次显示。因此每次点击时selection的值都会增加。语法如下:<maction actiontype="toggle" selection="positive-integer" > expression1 expression2 expressionN </maction>
  • +
  • tooltip: 当指针指向表达式时触发,会在表达式附近显示一个提示框。语法如下:<maction actiontype="tooltip"> expression message </maction>
  • +
+
+
class, id, style
+
样式表使用。
+
href
+
用来设置标签点击后跳转的链接。
+
mathbackground
+
用来设置标签的背景色,可以使用#rgb#rrggbb或者HTML颜色名
+
mathcolor
+
用来设置文字和分数的线的颜色,同样可以使用#rgb#rrggbb或者HTML颜色名
+
selection
+
用来设置该行为作用在哪个子元素上,默认为1,代表第一个子元素。
+
+ +

例子

+ +

下面的例子演示了如何使用“toggle”这个actiontype

+ +
<math>
+
+<maction actiontype="toggle">
+
+  <mfrac>
+    <mn>6</mn>
+    <mn>8</mn>
+  </mfrac>
+
+  <mfrac>
+    <mrow>
+      <mn>3</mn>
+      <mo>&sdot;</mo>
+      <mn>2</mn>
+    </mrow>
+    <mrow>
+      <mn>4</mn>
+      <mo>&sdot;</mo>
+      <mn>2</mn>
+    </mrow>
+  </mfrac>
+
+  <mfrac>
+    <mn>3</mn>
+    <mn>4</mn>
+  </mfrac>
+
+</maction>
+
+</math>
+
+ +

规范

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('MathML3', 'chapter3.html#presm.maction', 'maction') }}{{ Spec2('MathML3') }}Current specification
{{ SpecName('MathML2', 'chapter3.html#presm.maction', 'maction') }}{{ Spec2('MathML2') }}Initial specification
+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatNo}}{{ CompatGeckoDesktop("1.0") }}{{CompatNo}}{{CompatNo}}{{CompatNo}} [2]
actiontype{{CompatNo}}{{CompatVersionUnknown}} [1]{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}} [4]
href{{CompatNo}}{{ CompatGeckoDesktop("7.0") }}{{CompatNo}}{{CompatNo}}10.0 {{webkitbug(85733)}} [3]
mathbackground{{CompatNo}}{{ CompatGeckoDesktop("2.0") }}{{CompatNo}}{{CompatNo}}5.1
mathcolor{{CompatNo}}{{ CompatGeckoDesktop("2.0") }}{{CompatNo}}{{CompatNo}}5.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatNo}}{{ CompatGeckoMobile("1.0") }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
actiontype{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}} [1]{{CompatNo}}{{CompatNo}}{{CompatNo}}
href{{CompatNo}}{{CompatNo}}{{ CompatGeckoMobile("7.0") }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
mathbackground{{CompatNo}}{{CompatNo}}{{ CompatGeckoMobile("2.0") }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
mathcolor{{CompatNo}}{{CompatNo}}{{ CompatGeckoMobile("2.0") }}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +

[1] 只包括 toggle 和 statusline, tooltip 暂未实现。参考 bug 544001.

+ +

[2] 参考 WebKit bug 85734.

+ +

[3] 参考 WebKit bug 85733.

+ +

[4] 只包括toggle, statusline 和 tooltip 暂未实现 。参考WebKit bug 120059.

+ +

Gecko具体说明

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