From efa32096547e8ca15db07c53b045dd351df23df2 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 20 Sep 2011 19:37:17 +0100 Subject: [PATCH] Fix example: Need element scope to calculate TD index! - 6647 --- examples/api/highlight.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/api/highlight.html b/examples/api/highlight.html index 18637c45..ff312d96 100644 --- a/examples/api/highlight.html +++ b/examples/api/highlight.html @@ -18,7 +18,7 @@ } ); $('td', oTable.fnGetNodes()).hover( function() { - var iCol = $('td').index(this) % 5; + var iCol = $('td', this.parentNode).index(this) % 5; var nTrs = oTable.fnGetNodes(); $('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' ); }, function() { @@ -474,7 +474,7 @@ } ); $('td', oTable.fnGetNodes()).hover( function() { - var iCol = $('td').index(this) % 5; + var iCol = $('td', this.parentNode).index(this) % 5; var nTrs = oTable.fnGetNodes(); $('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' ); }, function() {