2012-03-14 107 views
1

關於使用什麼鍵盤快捷鍵訪問列標題中的tablesorter控件的想法?或軟件處理程序/其他支持508遵從性(以支持通過鍵盤訪問這些控件)?jquery tablesorter - 508 compliance

+0

對不起,我不知道約508合規性,所以我必須問......如果沒有辦法「關注」它,如何使用鍵盤與桌子進行交互。如果頁面上有多個表格,這將是必要的。如果我有一些方向,我會很樂意在我的forkorter的分支上工作。 – Mottie 2012-03-15 19:28:48

回答

0

爲此,我肯定會去一個預先存在的圖書館。可訪問的表格有一些細微差別,可能會耗費時間,如果您對屏幕閱讀器沒有經驗,可能很難進行測試。

我最喜歡的,當談到漂亮的表,是YUI 3:

http://yuilibrary.com/yui/docs/datatable/

他們的圖書館是實心的,而且他們的文檔是太棒了。只要確保按照他們的例子獲得全部好處。您可以輕鬆訪問可訪問的圖書館並建立無法訪問的網站。

+0

自這個答案以來,在YUI上的開發已經停止。 https://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui – 2016-11-19 04:08:01

1
<script type="text/javascript"> 
     $(document).ready(function() { 
      <%--Applies the jQuery tablesorter plugin to any table with the class "addTableSorter"--%> 
      <%--Also enables tabbing to and pressing enter on the headers to sort for 508 compliance--%> 
      $('table.addTableSorter') 
     .tablesorter() 
     .find('th') 
      .keypress(function(e) { 
      if (e.which == 13) { //code for enter key 
       e.preventDefault(); 
       $(this).trigger('click'); //simulate a click 
      } 
     }) 
    .attr('tabindex', '0'); 
    }); 
    </script>