您好, 请教javascript

duqiu155 2008-06-23 10:24:57

2.当鼠标经过一个表格时,改变表格的背景颜色为#00AAFF,请补全代码,鼠标移开时,还原表格背景颜色(#FFFFFF)
<table>
<tr>
<td onmouseover="over" onmouseout="out()" ></td>

</tr>
</table>
<script language="javascript" >
function over()
{

}
function out()
{


}

</script>
...全文
83 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
fuyou001 2008-06-25
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 s_liangchao1s 的回复:]
HTML code
<table>
<tr>
<td onmouseover="over(this)" onmouseout="out(this)" >111 </td>
</tr>
</table>
<script language="javascript" >
function over(oTd){
oTd.style.backgroundColor = "#00AAFF";
}
function out(oTd){
oTd.style.backgroundColor = "#FFFFFF";
}


</scr…
[/Quote]
顶这个
brightxu 2008-06-25
  • 打赏
  • 举报
回复
借贵地一用:
请问各位,用javascript写得网页里,我查看源代码,为什么看不到数据啊?应该是数据的地方是一些如:=BB的一些符号和字符组合。为什么啊?看不懂!!谢谢各位!
duqiu155 2008-06-25
  • 打赏
  • 举报
回复

兄弟谢了!
阿云ivan 2008-06-24
  • 打赏
  • 举报
回复
<table>
<tr>
<td onmouseover="this.style.backgroundColor ='#00AAFF'"
onmouseout="style.backgroundColor = '#FFFFFF'">当鼠标经过一个表格时,改变表格的背景颜色为#00AAFF,请补全代码,鼠标移开时,还原表格背景颜色(#FFFFFF)</td>
</tr>
</table>
PrewinZZZ 2008-06-23
  • 打赏
  • 举报
回复
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow )
{
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#C0C0FF';this.style.cursor='hand';");
//当鼠标移走时还原该行的背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
}
}

给你这个参考一下,Attributes里就是js
s_liangchao1s 2008-06-23
  • 打赏
  • 举报
回复

<table>
<tr>
<td onmouseover="over(this)" onmouseout="out(this)" >111 </td>
</tr>
</table>
<script language="javascript" >
function over(oTd){
oTd.style.backgroundColor = "#00AAFF";
}
function out(oTd){
oTd.style.backgroundColor = "#FFFFFF";
}


</script>

乌镇程序员 2008-06-23
  • 打赏
  • 举报
回复
function over() {
this.backgroundColor = '#00AAFF';
}

function out() {
this.backgroundColor = '';
}

87,921

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧