David Duymelinck schrieb:
> Jez McKean schreef:
>> Hi all,
>> has anyone made this as (part of) a plugin?
>>  
> Just use the hover function, there is no plugin needed.
> 
> $("td").hover(function(){
>   $(this).addClass("over");
> },function(){
>   $(this).addClass("out");
> });

No, unfortunately it's not that easy if you want to highlight a complete 
column...

You would have to 1. get the index of the cell the cursor is currently 
over and then highlight every cell with that index in every row...

Here's a quick, untestet attempt:

$('td').hover(

     function() {
         var pos = $('td', this.parentNode).index(this);
         $(this).parent('table').find('td').eq(pos).addClass('hover');
     },

     function() {
         // same as above but with removeClass instead of addClass
     }

)

And then it's becoming more difficult if you start to think about what 
to do with cells that are merged via colspan...


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to