鼠標劃過高亮度顯示所在的行
<table width=100% bgcolor=cccccc onmouseout="select_row(null)">
<tr id="row0" onmouseover="select_row(this)">
<td>
...
</td>
</tr>
<tr id="row0" onmouseover="select_row(this)">
<td>
...
</td>
</tr>
<tr id="row0" onmouseover="select_row(this)">
<td>
...
</td>
</tr>
</table>
<script language="javascript">
var theCurrentTr;
function select_row(obj)
{
if(theCurrentTr!=null) theCurrentTr.bgColor="";
theCurrentTr=obj;
if(theCurrentTr!=null) theCurrentTr.bgColor="blue";
}
</script>
<br>
<br>
移出時還記錄最后鼠標所在的行:
<table width=100% bgcolor=cccccc>
<tr id="row0" onmouseover="select_row(this)">
<td>
...
</td>
</tr>
<tr id="row0" onmouseover="select_row(this)">
<td>
...
</td>
</tr>
<tr id="row0" onmouseover="select_row(this)">
<td>
...
</td>
</tr>
</table>
posted on 2008-12-20 17:19 強強 閱讀(253) 評論(0) 編輯 收藏 所屬分類: web技巧