【问题标题】:How to make Meteor.js accessible to e.g. blind people?如何使 Meteor.js 可访问,例如盲人?
【发布时间】:2014-02-26 15:05:45
【问题描述】:

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

【问题讨论】:

标签: meteor accessibility


【解决方案1】:

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

此外,Mozilla 开发网络有一个 dedicated section 和一个 FAQ 来帮助您。

例子简单的这么说,直接标记中的进度条例子

<div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" />

或者更好的是,通过 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);
}

关于 Meteor,既然它是一个丰富的 Web 应用程序开发框架,你可以通过所有 aria 属性为你疯狂。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-03
    • 2011-06-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多