[英]How to hide ARIA-LIVE from screen readers but make they will can read content inside?
I have on page ARIA-LIVE block like this: 我在页面上的ARIA-LIVE块如下所示:
<div
aria-live='polite'
role='log'
aria-relevant='additions'
aria-atomic='false'
style='position: absolute; width: 1px; height: 1px; margin-top: -1px; clip: rect(1px, 1px, 1px, 1px); overflow: hidden;'>
<div>message</div>
<div>message</div>
</div>
And now, if i using keyboard arrows, screen reader can reach aria-live zone, it is located at the very bottom of the page, and read content which he contain. 而现在,如果我使用键盘箭头,则屏幕阅读器可以到达Aria-live区域,它位于页面的最底部,并可以读取其中包含的内容。
Is there a way to hide the aria-alive zone but at the same time make it so that the content in it is still normally read by the reader? 有没有一种方法可以隐藏aria-alive区域,但同时又将其隐藏起来,以便读者仍然可以正常阅读其中的内容?
That's kind of like asking how can one apply CSS display:none
to an element but still allow the element to be seen. 这有点像问如何将CSS display:none
应用于元素,但仍然允许该元素可见。
You can hide elements from a screen reader by specifying aria-hidden="true"
. 您可以通过指定aria-hidden="true"
从屏幕阅读器隐藏元素。 If you also have aria-live
, then any updates to that element will be hidden from screen readers, essentially negating the purpose of having aria-live
. 如果您还拥有aria-live
,那么屏幕阅读器将隐藏对该元素的任何更新,从根本上消除了拥有aria-live
的目的。
About the best you can do is associate a label with that region to say "this element is for announcing dynamic updates", or something like that. 最好的办法是将标签与该区域相关联,以表明“此元素用于宣布动态更新”或类似的内容。 A screen reader user may find it, but it doesn't hurt anything. 屏幕阅读器用户可能会找到它,但没有任何伤害。 They can easily ignore it and move on to the next element. 他们可以轻松地忽略它并继续进行下一个元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.