1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-18 11:52:11 +01:00

Update highlight example to use $ API method

This commit is contained in:
Allan Jardine 2011-12-14 17:51:06 +00:00
parent 9ebabaf089
commit 4bfe3d7c89

View File

@ -17,12 +17,11 @@
"bSortClasses": false
} );
$('td', oTable.fnGetNodes()).hover( function() {
oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 5;
var nTrs = oTable.fnGetNodes();
$('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' );
$('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
$('td.highlighted', oTable.fnGetNodes()).removeClass('highlighted');
oTable.$('td.highlighted').removeClass('highlighted');
} );
} );
</script>
@ -473,12 +472,11 @@
"bSortClasses": false
} );
$('td', oTable.fnGetNodes()).hover( function() {
oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 5;
var nTrs = oTable.fnGetNodes();
$('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' );
$('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
$('td.highlighted', oTable.fnGetNodes()).removeClass('highlighted');
oTable.$('td.highlighted').removeClass('highlighted');
} );
} );</pre>
<style type="text/css">