2014-02-26 43 views
4

Meteor.js網站上沒有任何內容,沒有標記,我怎樣才能讓這個網站可以被盲人,聾啞人等使用?如何讓Meteor.js可以訪問例如盲人?

+0

這與我爲Angular所做的答案非常相似:http://stackoverflow.com/questions/18853183/what-are-the-accessibility-implications-of-using-a-framework-like-angularjs/18861097 #18861097 – AlastairC

回答

6

W3C有一個專門爲富Web應用程序設計的可訪問性計劃。這個概念太大,在這裏總結一下,但包括一些最佳做法以及標籤和屬性,圍繞所謂ARIA

而且旋轉,Mozilla的開發網絡具有dedicated sectionFAQ,讓你去。

的例子只是把它像這樣一個進度條,例如直接標記

<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); 
} 

關於流星,既然它是一個豐富的網絡應用程序開發框架,那麼您可以用所有的詠歎調屬性來瘋狂。

相關問題