简体   繁体   English

防止阅读每一个动态变化:是否有一个咏叹调 - 生活=“僵尸”?

[英]Prevent reading every dynamic change: is there an aria-live=“zombie”?

I have a <div> tag where I'm updating the text every few milliseconds. 我有一个<div>标签,我每隔几毫秒更新一次文本。 Visually, I can see the text flashing by, which is good. 在视觉上,我可以看到文字闪烁,这很好。

I want to make it an aria-live region so I can hear the text flashing by too, but I don't want JAWS to read every text change. 我想让它成为一个咏叹调的区域,所以我也可以听到文字闪烁,但我不希望JAWS读取每一个文本的变化。 It'll get too bogged down. 它会陷入困境。

So if I change the text 4 times by the time jaws finishes reading the first change, I want jaws to ignore the other 3 changes and to just say the next change (5th change), and so on. 因此,如果我在下颌完成第一次更改时更改文本4次,我希望下颚忽略其他3个更改,并只说下一个更改(第5个更改),依此类推。 The missed 3 changes aren't important. 错过的3次变化并不重要。

So I sort of have an aria-live region that's not really alive and it's not really dead. 所以我有一个咏叹调的生活区域并没有真正活着而且它并没有真正死亡。 I need some kind of zombie middle ground. 我需要某种僵尸中间地带。

I've tried various combinations of 'polite' and 'assertive' as well as aria-busy but nothing I've tried works. 我尝试了各种“礼貌”和“自信”以及咏叹调的组合,但我没有尝试过。

Any ideas? 有任何想法吗?

You can keep an empty <div aria-live="polite"></div> in the bottom of your document. 您可以在文档底部保留一个空的<div aria-live =“polite”> </ div>。 Then inject a copy of the text you want to say at certain intervals into the aria-live div and then remove the text from the aria-live div a second or so later. 然后将您要以特定间隔说出的文本副本注入aria-live div,然后在大约一秒钟后从aria-live div中删除文本。

Be careful how you use it though. 但要小心你如何使用它。 I could see examples of usage being announcing percentage of loading, or for a live population counter where you may want to announce it every couple of seconds or so. 我可以看到使用的示例,即宣布加载百分比,或者对于您可能希望每隔几秒左右宣布一次的实时人口计数器。

For the most part though let the screen-reader do what it's meant to do. 在大多数情况下,让屏幕阅读器完成它的意图。 Sometimes we over-think a solution. 有时我们过度思考解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM