- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试让 aria-live 区域能够与 JAWS 11 和 IE8 正常工作。
使用下面的代码,我可以让 JAWS 在单击按钮时宣布新值,但行为不是我所期望的。
<!DOCTYPE html>
<html>
<head></head>
<body>
<button onclick="document.getElementById('statusbar').innerHTML = parseInt(document.getElementById('statusbar').innerHTML) + 1">Update</button>
<div id="statusbar" aria-live="polite">0</div>
</body>
</html>
使用我的 JAWS11/IE8 配置,每次单击按钮时我都会听到:
Click number HTML Value (after click) JAWS says------------ ------------------------- ---------1 1 "Update button 0"2 2 "1"3 3 "2"
问题,我的问题是:如何让 JAWS 宣布 aria-live 区域的当前值,而不是 aria-live 区域的先前值?
我还对其他屏幕阅读器如何处理此功能感兴趣。
最佳答案
您的代码是正确的。显然,“后面的1”已经是discovered 。从链接来看,使用 aria-atomic="true"似乎可以解决该问题。但是,给出的示例确实在 IE9 和 Firefox 中正常工作。
如果您还没有偶然发现它们,请查看 codetalks 上的测试用例和 accessibleculture.org 。有很多细微的差别需要注意。当测试失败时不要感到惊讶!在过去一年左右的时间里,我遇到了一些(不充分的)技巧,可能会对您有所帮助。
方法一:role="alert"
alert
角色是 supposed to be相当于 aria-live="assertive"
,但旧版本的 JAWS 无法正确处理它。查看these examples从 2011 年 2 月开始,其中指出:
If you are looking to support JAWS 10 in IE7 or IE8 at all, it is likely best to double up on alerts with both role="alert" and aria-live="assertive". While this is somewhat redundant since, by definition, the alert role is to be processed as an assertive live region, doing so does allow JAWS 10 to automatically announce the updated alert's contents in those two browsers.
Firefox4+ 和 IE9 都不需要这个。但它会是这样的:
<div id="statusbar" role="alert" aria-live="assertive">
Contents will be spoken when changed
</div>
方法二:焦点强制破解
通过动态创建 DOM 元素并强制将焦点置于其上,您可以“欺骗”大多数屏幕阅读器来阅读内容。这是很hackish,但是有效......并且在某种程度上是Create and Focus的要点。例子。简单来说,你可以这样做:
<div id="statusbar" role="alert"></div>
$('#statusbar')
.clear()
.append('<div tabindex="-1">' + newString + '</div>')
.children().first().focus()
;
大多数情况下,仅仅隐藏/显示内容实际上效果相当好。然而,VoiceOver的焦点停留在元素上,再次显示时不会说出其内容。因此,从 DOM 中删除它似乎是目前最简单的方法。我不喜欢这样,但事情就是这样。
关于accessibility - aria-live 和 JAWS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6908701/
我在使用 jquery 1.9.1 时遇到问题。我已经搜索过,但这些都没有解决我的问题。 $('.sm2_expander').live('click', function() { $
有些 Live CD 可以启动操作系统并允许您无需安装即可使用它。 我想知道是否有一种简单的方法来自定义 Live CD,以便它只加载运行一个应用程序所需的内容,然后运行该应用程序。 最佳答案 对于
当我从 Live CD 启动 Linux Mint 时,我能够将文件保存到“文件系统”。但这些文件保存在哪里呢?不可能是光盘,因为它是 CDR。我不认为它存储在 RAM 中,因为它只能保存这么多数据,
我正在尝试 ZIO . 我不明白为什么要添加Live作为Trait,然后提供一个object,比如: object Live extends Live 在不同的地方可以找到这种模式,例如 zio.co
我正在尝试播放 RTSP 直播流媒体网址“rtsp://164.100.51.207/broadcast/DDLive”。但我收到此错误 (1,-1)。 我正在尝试这段代码 VideoView myV
如何更改标签的 html,如下所示: $('#someId').html('foo bar'); 使用 live() 或 delegate() 函数时?只是为了澄清,我不希望这种情况发生在悬停、焦点或
我在这里没有看到很多关于 Microsoft 提供的 xbox live api 的帖子。谁能给我指一个有活跃的 xbox live api 社区的网站? 最佳答案 这是相当模糊的,所以我会提供一个广
我有一个带有 class="centerMessage" 的 div 。该 div 会在页面加载后的某个时刻插入到 DOM 中。我想更改此 div 上的 CSS 以使其居中。我尝试了下面的CSS功能,
我正在开发一个应用程序,我需要将通过智能手机的摄像机(在 iPhone 和 Android 手机上)捕获的视频流式传输直接到 YouTube Live。 我研究了 Codename One 的 Cap
当使用 DLT 时,我们可以使用 STREAMING LIVE TABLE 或 LIVE TABLE 创建一个实时表,如文档中所写: CREATE OR REFRESH { STREAMING LIV
所以,我在一个网站上工作,我希望用户能够使用他们的 xbox 帐户登录,将他们的玩家标签链接到我的网站。我可以像这样使用 oauth: 但是,我不知道如何获得 xbox live 权限。执行此操作的其
我正在使用苹果的 http 实时流媒体将实时视频流式传输到 ipad/iphone。其中一个重要的步骤是将传输流与播放列表一起分割成几个 ts 段。根据苹果的文档,推荐的 ts 段持续时间为 10 秒
我正在尝试实现“使用 Outlook.com 登录”流程,其中涉及客户端和服务器代码。 流程是: 从客户端将用户重定向到: https://login.live.com/oauth20_authori
如果您使用 YouTube 直播打开广播“事件”,用户可以使用回放功能,让他们无需离开界面即可观看过去 3 小时的广播 - 您可以像观看视频一样轻松观看,但您仍处于广播中,您只需控制过去缓冲的分钟数。
我有一个使用 HTTP Live Streaming 传送视频内容的应用程序。我希望应用程序根据设备屏幕尺寸(4x3 或 16x9)检索适当的分辨率。我运行 Apple 的工具来创建主 .m3u8 播
我有一个使用 HTTP Live Streaming 传送视频内容的应用程序。我希望应用程序根据设备屏幕尺寸(4x3 或 16x9)检索适当的分辨率。我运行 Apple 的工具来创建主 .m3u8 播
super 快的。这是我的 .gitignore(在我的 repo 的根级别 # Makefile stuff LIVE-* .install-post-all 当我这样做时,LIVE-* 位不起作用
因此,我在 Gamasutra 阅读了 John Carmack 的采访,其中他谈到了他所谓的“存在于内存映射文件中的实时 C++ 对象”。以下是一些引用: JC: Yeah. And I actua
在教师端对类(class)进行更改后,有预览更改和查看实时版本的选项,但目前这两个选项都无法正常工作,我们必须在 URL 中附加基本 url (www.abc.com/)是时候预览更改或查看实时版本了
有人可以详细说明aria-live="assertive"之间的区别吗?和 aria-live="polite" ? 据我了解 aria-live="assertive"将获得更高的优先级并清除队列,
我是一名优秀的程序员,十分优秀!