2014-02-17 66 views
3

我是ARIA新角色。如果我有工具提示类型的功能,即如果有人点击问号按钮,会显示更多文本详细说明如何填写表单字段,我应该使用aria-expanded属性,aria-hidden属性还是两者?ARIA - 您是否需要使用ARIA-EXPANDED和ARIA-HIDDEN?

<div class="login-form-field tt-highlight"> 
    <div class="error-message error-style"> 
     <p>Sorry you have not entered anything in the field above.</p> 
    </div> 
    <div class="col-xs-10 col-sm-10 col-md-10"> 
     <label for="inputTxtCustomerPostcode" class="login" />Postcode:</label> 
     <input id="inputTxtCustomerPostcode" type="text" /> 
    </div> 
    <div class="col-xs-2 col-sm-2 col-md-2"> 
     <a title="Please enter a valid case reference tooltip" class="login-tooltip" data-toggle="collapse" data-parent="#accordion" href="#collapseTxtCustomerPostcode" role="button" aria-pressed="false"></a> 
    </div> 

    <div id="collapseTxtCustomerPostcode" class="panel-collapse collapse" role="tree tooltip"> 
     <div class="panel-body" role="treeitem" aria-expanded="false" aria-hidden="true"> 
      <p>some text goes here for the tooltip</p> 
     </div> 
    </div> 
</div> 

回答

2

使用RDF model图,以帮助:

RDF Data Model Diagram

aria-expanded为通过继承treeitem角色定义。

aria-disabled是所有角色定义,但是有这样的警告:

注:作者是尽量避免使用ARIA隐藏=“假”的风格,或在历史上防止呈现在所有形式的属性,例如display:none或visibility:隐藏在CSS中,或HTML 5中的隐藏属性。在撰写本文时,已知aria-hidden =“false”在与这些功能结合使用时工作不稳定。随着未来实施的改进,在依靠此方法之前应谨慎使用并进行彻底测试。

因此,aria-expanded本身应该足够。

参考

相关问题