最初の 24 の子にホバーを追加して、他の要素の 24 の個別の要素に塗りつぶしを追加したいと考えています。
そのようです:
$('tr td:nth-child(1)').mouseover(function(){
$('rect:nth-of-type(1)').css("fill", "black" );
});
$('tr td:nth-child(2)').mouseover(function(){
$('rect:nth-of-type(2)').css("fill", "black" );
});
$('tr td:nth-child(3)').mouseover(function(){
$('rect:nth-of-type(3)').css("fill", "black" );
});
しかし、私は自分自身を24回繰り返したくありません。これを処理する最良の方法は何ですか?