是“aria-haspopup"吗?属性主要用于工具栏菜单?

2022-01-20 00:00:00 popup html wai-aria

我已经看到 aria-haspopup 属性被用于应用程序的工具栏菜单,例如 所见即所得编辑器.但是,我还没有看到它被用于任何 ARIA 演示网站的主导航.

I have seen aria-haspopup attribute being used on toolbar menu of applications such as WYSIWYG editor. However, I haven't seen it being used on the main navigation in any ARIA demonstration website.

这个属性主要是为应用程序的工具栏菜单引入的吗?在网站的主导航(有子菜单)上使用它是否合适合理?

Was this attribute introduced mainly for toolbar menu of applications? Is it appropriate and reasonable to use it on the main navigation (which has submenu) of a website?

推荐答案

刚刚看到这个属性被用在 jQuery UI Selectmenu(在a元素上,是选择菜单的开关).所以似乎可以在任何代码上使用它.

Just saw this attribute being used on the markup of jQuery UI Selectmenu (on the a element, which is the switch of selectmenu). So it seems to be okay to use it on any code.

<span class="ui-selectmenu-button css-scope">
    <a class="ui-corner-all ui-state-default ui-widget ui-button" href="#speed" tabindex="0" id="speed-button" role="combobox" aria-expanded="false" aria-autocomplete="list" aria-owns="speed-menu" aria-haspopup="true">
        <span class="ui-icon-triangle-1-s ui-icon"></span>
        <span class="ui-selectmenu-text">Medium</span>
    </a>
 </span>

相关文章