I have 2 group of IDs, one it's called "Andrea" and the second one "Robert". Every group runs from 1 to 40 so i have for example:
Andrea1,#Andrea2,#Andrea3,#Andrea4 etc..
and the same for Robert:
Robert1,#Robert2,#Robert3,#Robert4 etc...
I need to link each other every ID like this for example:
$(document).ready(function(){
$("#Andrea1").hover(function(){
$("#Andrea1").fadeOut('slow');
$("#Robert1").fadeOut('slow');
}, function(){
$("#Andrea1").fadeIn('slow');
$("#Robert1").fadeIn('slow');
});
});
but as you know it's not intelligent do 40 of that. So my question is this: is there a way to do it in a smarter way? Something like this: (i know it's not correct but it's a way to explain it)
$(document).ready(function(){
$("#Andrea[i]").hover(function(){
$("#Andrea[i]").fadeOut('slow');
$("#Robert[i]").fadeOut('slow');
}, function(){
$("#Andrea[i]").fadeIn('slow');
$("#Robert[i]").fadeIn('slow');
});
});