jquery tablesorter - 508合规性

时间:2012-03-14 14:40:47

标签: jquery tablesorter section508

了解用什么键盘快捷键来访问列标题中的tablesorter控件?或软件处理程序/其他支持508合规性(以支持通过键盘访问这些控件)?

2 个答案:

答案 0 :(得分: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>

答案 1 :(得分:0)

为此,我肯定会使用预先存在的库。可访问的表格有一些细微差别,可能会耗费时间,如果您没有屏幕阅读器的经验,可能很难测试。

我喜欢的,当它出现在漂亮的桌子上时,是YUI 3:

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

他们的图书馆很扎实,而且他们的文档太棒了。只要确保按照他们的例子来获得全部好处。您可以使用无障碍图书馆,轻松建立无法访问的网站。

相关问题