<maction> - MathML 编辑

The MathML <maction> element provides a possibility to bind actions to (sub-) expressions. The action itself is specified by the actiontype attribute, which accepts several values. To specify which child elements are addressed by the action, you can make use of the selection attribute.

Attributes

actiontype
The action which specifies what happens for this element. Possible values are:
  • statusline: If there is a click on the expression or the reader moves the pointer over it, the message is sent to the browser's status line. The syntax is: <maction actiontype="statusline"> expression message </maction>.
  • toggle: When there is a click on the subexpression, the rendering alternates the display of selected subexpressions. Therefore each click increments the selection value.
    The syntax is: <maction actiontype="toggle" selection="positive-integer" > expression1 expression2 expressionN </maction>.
  • tooltip: When the pointer moves over the expression, a tooltip box with a message is displayed near the expression.
    The syntax is:<maction actiontype="tooltip"> expression message </maction>.
class, id, style
Provided for use with stylesheets.
displaystyle
A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also largeop and movablelimits on <mo>.
href
Used to set a hyperlink to a specified URI.
mathbackground
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor
The text color and also the fraction line color. You can use #rgb, #rrggbb and HTML color names.
selection
The child element which is addressed by the action. The default value is 1, which is the first child element.

Examples

The following example uses the "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>

Specifications

SpecificationStatusComment
MathML Core
The definition of 'maction' in that specification.
DraftDraft specification
MathML 3.0
The definition of 'maction' in that specification.
RecommendationCurrent specification
MathML 2.0
The definition of 'maction' in that specification.
RecommendationInitial specification

Browser compatibility

BCD tables only load in the browser

Gecko-specific notes

  • Prior to Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6) the non-standard restyle value on the actiontype attribute was supported. This value has been removed.
  • Prior to Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11) the statusline action type was using a non-standard syntax (see below). This has been fixed to follow the MathML specification.
    <maction actiontype="statusline#(message)">
    (expression)
    </maction>
    
  • With Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) the selection attribute is only taken into account with the actiontype "toggle".
  • Starting with Gecko 16.0 (Firefox 16.0 / Thunderbird 16.0 / SeaMonkey 2.13) the selection attribute is also taken into account when an unknown actiontype is specified. If an actiontype is not specified (is empty) or when the selection attribute is invalid, the markup will throw an MathML error (invalid-markup).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:133 次

字数:6431

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文