2012-03-14 83 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>