我在其中一本jQuery書籍中看到,您可以突出顯示正在排序的列。突出顯示一列
$('th.sortable').click(function() {
var $th = $(this);
var column = $th.index();
var $table = $th.closest('table');
var rows = $table.find('tr:not(:has(th))').get();
問:如何將'hightlight'類添加到單擊的列中的每個單元格?
請注意,_index_是基於零的,而_nth-child_是基於1的。 – 2010-10-19 20:28:19
你說得對,我已經更新了。 – Harmen 2010-10-19 20:28:48