当我将鼠标悬停在表格上时,我需要改变表格中文本的颜色。为此,我使用:
$('.afishaitem_active').hover(
function(){
$(this).css({'border':'solid 1px #ED5353','background-color':'#FFF','color':'#ED5353'});
$('.afishaitem_up_left_active').css('color','#000');
},
function(){
$(this).css({'border':'none','background-color':'#ED5353','color':'#FFF'});
$('.afishaitem_up_left_active').css('color','#000');
}
);
和表:
<table id="afishaitem_active" class="afishaitem_active" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0" id="afishaitem_up">
<tr valign="top">
<td class="afishaitem_up_left_active">'.$d.'</td>
<td class="afishaitem_up_right_active">data</td>
</tr>
</table>
</td>
</tr>
<tr valign="top" style="line-height:11px">
<td class="afishaitem_seet_active">seet</td>
</tr>
<tr valign="top">
<td class="afishaitem_name_active">name</td>
</tr>
</table>
将鼠标悬停在表格上时,边框样式和背景颜色会发生变化,但文本颜色不会。
为什么文字的颜色没有变化?