I'm trying to sync hovering in two diferente tables... but for some reason when only the first part of the function works, adding the second part breaks the first part and gives me no errors.
I did not put it into the jsfiddle because its not a visual thing... its pure code that's breaking somewhere.
$(function(){
//first part
var trsCont = $('#conteudo table tr');
for (i = 0; i < trsCont.length; i++) {
trsCont.eq(i).hover(
function () {
$('#coluna_fixa table tr').eq(i-1).toggleClass("hovered");
}
);
}
//second part
var trsCol = $('#coluna_fixa table tr');
for (i = 0; i < trsCol.length; i++) {
trsCol.eq(i).hover(
function () {
$('#conteudo table tr').eq(i+1).toggleClass("hovered");
}
);
}
});
I know I am doing something wrong... can someone just point it out?
Thanks for reading this far.