If you use markup such as:
<table>
<thead>
<tr>
<th>Heading 1</th>
...
</tr>
</thead>
<tbody>
<tr>
<td>Data...</td>
...
</tr>
</tbody>
</table>
You can then do:
$('#docstable tbody tr').hover(function(){ $(this).addClass('trover'); },
function() { $(this).removeClass('trover') });
Cheers,
-js
On 2/12/07, Rigent <[EMAIL PROTECTED]> wrote:
I have what is probably a newbie question.
I have a table displaying data and use the following script to create a
highlight on a row, except for the first row (.headingrow) because it's
used
as the header for the table.
$("#docstable").find("tr").not(".headingrow").mouseover(function(){$(this).addClass("trover")});
$("#docstable").find("tr").not(".headingrow").mouseout(function(){$(this).removeClass("trover")});
This works fine but my question is would there be a more efficient way to
do
this, without having to add the class to the first row of the table? Since
it may not always be possible to apply a class to that row.
I imagine there is a way to search for; all the siblings of the first row
but not that row itself, or to search for all TRs that have TDs as
children.
Cheers
--
View this message in context:
http://www.nabble.com/Selecting-all-other-siblings-tf3215034.html#a8928263
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/