让 JAWS 忽略 html 元素
我目前正在尝试使我的应用程序对那些视力有困难的人来说更加用户友好。正如人们所料,我正在使用 JAWS 来测试我的应用程序。我遇到的大多数问题都相对容易解决,但我被一个问题难住了。
在我的应用程序中,我通过 iframe 注入了广告,我希望 JAWS 忽略它们,但我仍然希望它们显示(display:none 是不可能的)。有没有办法让 JAWS 完全忽略一个元素及其所有子元素?
我看到一些帖子导致了 talk:none,但这不起作用。它似乎确实忽略了父级 div,但它会读取 iframe 子级的内容。
任何提示将不胜感激。
谢谢。
I am currently attempting to make my application be more user friendly to those with difficulty seeing. As one would expect, I am using JAWS to test my application. Most of the issues I have run in were relatively easy to fix, except I am stumped on one.
In my application, I have advertisements injected via an iframe and I want JAWS to ignore them, but I still want them to display (display:none is out of the question). Is there any way to have JAWS completely ignore an element and all of its children?
I saw a few posts leading towards speak:none, but that does not work. It does seems to ignore the parent div, but it will instead reads the content of the iframe child.
Any tips would be greatly appreciated.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
非常适合您测试 Web 应用程序的可访问性。
JAWS 已经内置了通过暂时或永久忽略内联 iframe 来忽略广告的功能。
测试您的网站在切换该功能的情况下是否能正常工作应该代表 JAWS 用户的典型体验。
上面链接中提到的其他要点将使您了解要避免的其他不良做法。
Good for you for testing your web application for accessibility.
JAWS already has the feature built-in to ignore ads by temporarily or permanently ignoring inline iframes.
Testing that your site works nicely with that feature toggled should represent the typical experience for a JAWS user.
The other points mentioned on the above link will give you a good idea of additional bad practices to avoid.
将 ARIA 属性
aria-hidden="true"
赋予 iframe 的外部 div。理想情况下,这应该对 JAWS 隐藏内容。Give the ARIA attribute
aria-hidden="true"
to the outer div of the iframe. This should ideally hide the the content from JAWS.将 aria 属性 role="presentation" 赋予您想要忽略的任何元素。 Jaws不会读它们。
Give the aria attribute role="presentation" to any element you want ignored. Jaws will not read them.