1

关于使用哪些键盘快捷键来访问列标题中的表格排序器控件的任何想法?或软件处理程序/其他支持 508 合规性(支持通过键盘访问这些控件)?

4

2 回答 2

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>
于 2012-04-04T19:33:52.657 回答
0

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

当谈到漂亮的桌子时,我最喜欢的是 YUI 3:

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

他们的库很扎实,他们的文档很棒。只需确保遵循他们的示例即可获得全部好处。您可以使用一个可访问的库并很容易地创建一个无法访问的站点。

于 2012-03-21T11:48:00.160 回答