我正在编写一个nwjs游戏,并希望为其添加辅助功能。
目前,我正在使用`aria-live`属性与屏幕阅读器进行通信。 `document.getElementById("game").setAttribute("aria-live", "assertive")`
我通过以下方式宣布消息: `document.getElementById("game").setAttribute("aria-label", "my text")`
这样做是有效的,但我需要一种中断的方式。
无论是"assertive"还是"polite"的`aria-live`设置都不起作用。 我尝试将标签文本设置为空或". !",但也不起作用。
有没有办法做到这一点?或者在nwjs的JavaScript应用程序中与屏幕阅读器进行通信的更好方法?
目前,我正在使用`aria-live`属性与屏幕阅读器进行通信。 `document.getElementById("game").setAttribute("aria-live", "assertive")`
我通过以下方式宣布消息: `document.getElementById("game").setAttribute("aria-label", "my text")`
这样做是有效的,但我需要一种中断的方式。
无论是"assertive"还是"polite"的`aria-live`设置都不起作用。 我尝试将标签文本设置为空或". !",但也不起作用。
有没有办法做到这一点?或者在nwjs的JavaScript应用程序中与屏幕阅读器进行通信的更好方法?
aria-alert
的属性可以打断?我模糊记得有这样的东西,当警报或通知出现时,它可以立即显示结果?不过,这已经过去很久了,aria
的文档仍然很糟糕。 - undefined