ElementInternals: ariaOrientation 屬性
ElementInternals 介面的 ariaOrientation 屬性反映了 aria-orientation 屬性的值,該屬性指示元素的 is horizontal、vertical、unknown/ambiguous。
注意:在 ElementInternals 上設定 ARIA 屬性允許為自定義元素定義預設語義。這些預設語義可能會被作者定義的屬性覆蓋,但可以確保在作者刪除或根本未新增這些屬性時,預設語義仍然保留。有關更多資訊,請參閱 Accessibility Object Model explainer。
值
一個字串,其值可能為以下之一:
"horizontal"-
該元素是 horizontal。
"vertical"-
該元素是 vertical。
"undefined"-
該元素的 is unknown。
示例
在此示例中,ariaOrientation 的值設定為 "vertical"。
js
class CustomEl extends HTMLElement {
constructor() {
super();
this.internals_ = this.attachInternals();
this.internals_.ariaOrientation = "vertical";
}
// …
}
規範
| 規範 |
|---|
| 無障礙富網際網路應用程式 (WAI-ARIA) # dom-ariamixin-ariaorientation |
瀏覽器相容性
載入中…