如何使Meteor.js可以访问盲人?

use*_*152 4 accessibility meteor

在Meteor.js网站上没有正文,没有标记,我怎样才能使盲人,聋等网站可以访问?

Ser*_*soy 6

W3C有一个专门为富Web应用程序设计的可访问性计划.这个概念太大了,无法在这里总结,但包含一些最佳实践以及围绕所谓的ARIA的标签和属性.

此外,Mozilla开发网络还有专门的部分常见问题解答,可帮助您实现目标.

这个例子就像这样,直接标记中的进度条示例

<div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" />
Run Code Online (Sandbox Code Playgroud)

或者更好,通过javascript,因为应用程序应该是一个丰富的,而不是静态的HTML:

// Find the progress bar <div> in the DOM.
var progressBar = document.getElementById("percent-loaded");

// Set its ARIA roles and states, so that assistive technologies know what kind of widget it is.
progressBar.setAttribute("role", "progressbar");
progressBar.setAttribute("aria-valuemin", 0);
progressBar.setAttribute("aria-valuemax", 100);

// Create a function that can be called at any time to update the value of the progress bar.
function updateProgress(percentComplete) {
  progressBar.setAttribute("aria-valuenow", percentComplete);
}
Run Code Online (Sandbox Code Playgroud)

关于Meteor,因为它是一个丰富的Web应用程序开发框架,所以您可以使用所有aria属性疯狂.