Using the progressbar role - Accessibility 编辑

This technique demonstrates how to use the progressbar role and describes the effect it has on browsers and assistive technology.

The progressbar role should be used for an element that displays the progress status for a task that take a long time or consists of several steps.

A progressbar indicates that the user's request has been received and the application is making progress toward completing the requested action. If the actual value of the progressbar can be determined, the developer has to indicate this progress using the aria-valuenowaria-valuemin, and aria-valuemax attributes. If the progress value  is indeterminate, the developer should omit the aria-valuenow attribute.

As the task progresses, the aria-valuenow value has to be updated dynamically to indicate this progress to assistive technology products. 

If the progressbar is describing the loading progress of a particular region of a page, the author SHOULD use aria-describedby to point to the status, and set the aria-busy attribute to true on the region until it is finished loading. It is not possible for the user to alter the value of a progressbar because it is always readonly.

Note: Assistive technologies generally will render the value of aria-valuenow as a percent of the range between the value of aria-valuemin and aria-valuemax, unless aria-valuetext is specified. It is best to set the values for aria-valuemin, aria-valuemax, and aria-valuenow in a manner that is appropriate for this calculation. Note: Elements with the role progressbar have an implicit aria-readonly value of true.

Possible effects on user agents and assistive technology 

Screen readers should announce the progress updates as they occur. If the progress bar is labeled, the label text should be mentioned as well.

Note: Opinions may differ on how assistive technology should handle this. The information provided above is one of those opinions and therefore not normative.

Examples

Example 1: Basic progressbar with percentage values

<div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20 %</div>

Example 2: Using aria-valuetext 

<div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuetext="Step 2: Copying files... " aria-valuemax="100">
  Step 2: Copying files...
</div>

Working Examples:

Notes 

ARIA attributes used

Compatibility

TBD: Add support information for common UA and AT product combinations

Additional resources

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

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

发布评论

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

词条统计

浏览:42 次

字数:5821

最后编辑:7年前

编辑次数:0 次

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