Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude the first column from jquery hover

I have this function which enables hover event on a table. It currently excludes the header row but I also need it to exclude the very first column. Any ideas?

  $(".GridViewStyle > tbody > tr:not(:has(table, th))")                
                .mouseover(function(e) {  
like image 386
scouserider Avatar asked Jul 13 '11 16:07

scouserider


2 Answers

$(".GridViewStyle > tbody > tr:not(:has(table, th)) td:not(:first-child)")

but you will have hover or mouseover fired for tds not trs. so in handler you'll do

$(this).closest('tr')

to access tr which you was going to change style etc

like image 144
vittore Avatar answered Sep 23 '22 13:09

vittore


You could do:

    $(".GridViewStyle > tbody > tr:not(:has(table, th)) td:not(:eq(0))")
like image 35
Nicola Peluchetti Avatar answered Sep 24 '22 13:09

Nicola Peluchetti