列表页点击、鼠标经过离开背景变化

   <script type="text/javascript">
$(function () {
$("table tr").click(function () { $(this).addClass("aliveTrClick").siblings().removeClass("aliveTrClick"); })
.dblclick(function () { $(this).removeClass("aliveTrClick"); })
.mouseover(function () { $(this).addClass("aliveTr"); })
.mouseleave(function () { $(this).removeClass("aliveTr"); });
});
</script>
<style type="text/css">.aliveTr{ background:#DfE7D0;} .aliveTrClick{ background:#D0E7D0;}</style>
<table width="80%" border="1">
<tr>
<td>2003年</td>
<td>1000</td>
<td>2000</td>
<td>3000</td>
</tr>
<tr>
<td>2004年</td>
<td>4000</td>
<td>5000</td>
<td>6000</td>
</tr>
<tr>
<td>2005年</td>
<td>7000</td>
<td>8000</td>
<td>9000</td>
</tr>
</table>
05-11 15:24
查看更多