不工作我有一个HTML表:chaning CSS背景属性在IE
<table id=mytable>
<tr>
<th>Configurations</th>
<th>Dual 1.8GHz</th>
<th>Dual 2GHz</th>
<th>Dual 2.5GHz</th>
</tr>
</table>
,然后我写了下面:
<script type="text/javascript">
$('#mytable tr').hover(
function() {
$(this).css("background","yellow");
},
function() {
$(this).css("background","");
}
);
</script>
当我将鼠标悬停在表行,就成了黄色Firefox,但在IE中它变成了白色!有任何想法吗?
为IE尝试** backgroundColor **而不是**背景** – 2013-02-24 08:30:41
我在IE9上测试了您的代码,它是黄色:http://jsfiddle.net/uCKmj/242/ – richard 2013-02-24 08:34:06
它会更干净,代替使用CSS更可靠。 'table tr:hover {background-color:yellow; }' – JJJ 2013-02-24 08:35:29