如何使屏幕阅读器读出“1of7”/“2of7”什么样的信息?
据我了解,通过使用 role="treeitem" 加上 aria-setsize 和 aria-posinset,您可以使屏幕阅读器宣布集合中某个项目的位置,例如“1 of 7”或“2 of 7”。
有没有办法对其他组(例如菜单栏或选项卡条)执行相同的操作?我们当然不想仅仅为了实现这一点而强制执行“treeitem”角色。
提前致谢。
I understand that by using the role="treeitem" plus aria-setsize and aria-posinset you can make the screen reader announces the position of an item in a set such as "1 of 7" or "2 of 7".
Is there a way to do the same thing for other groups such as menu bar, or tab strip? We certainly don't want to enforce the "treeitem" role just to achieve this.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在创建菜单栏,则要使用的逻辑结构将是无序列表
屏幕阅读器遇到此列表时会通知用户存在 x 个项目的列表,例如“列表” 7 个项目”,但它不会告知用户每个链接项目的顺序位置,因此它会根据列表内容读出“Bullet:链接,Bullet:blah”。
如果用户了解步骤编号(例如顺序指令列表)很重要,那么使用有序列表会更合适,例如
使用 CSS,您可以删除数字,或更改有序列表的格式。删除数字与屏幕阅读器读出列表的方式没有什么不同,因此他们仍然会听到 1、2、3 等。
If you're creating a menu bar, a logical structure to use would be an unordered list
<ul>
A screenreader encountering this list would inform the user that a list of x items was present e.g. "list of 7 items", but it wouldn't inform the user of the ordinal position of each link item, so it would it would read out "Bullet: link, Bullet: blah" depending on the list contents.
If it is important for the user to be aware of the step number e.g. a list of sequential instructions, then using an ordered list would be more appropriate e.g.
Using CSS, you could remove the numbers, or change the formatting of the ordered list. Removing the numbers would make no different to how a screenreader read out the list, so they would still hear 1, 2, 3 etc.