I have a table and have a jquery script that does two things:
1) When a row gets moused-over, the background color is changed by adding a hover class
2) The link contained in the row is used to make the entire row a link.
<script type="text/javascript">
$(document).ready(function() {
var target = 'table.mytable tr.allrows';
var hoverClass = 'allrows_hover';
$(target).each(function() {
$(this).hover(
function() {
$(this).addClass(hoverClass);
status = $(this).find('a').attr('href');
},
function() {
$(this).removeClass(hoverClass);
status = '';
});
$(this).click(function() {
location = $(this).find('a').attr('href');
});
$(this).css('cursor', 'pointer');
});
});
</script>
Now the trouble is, I have a checkbox in one column on each row, and when I check the box it follows the link.
I considered excluding that column from the above but can't get that to work. Can anyone help me find a way to exclude either the td or - even better - the checkbox itself so I can click it but still get the nice hover effect on the rest of the row?
Thanks in advance.