大家牛年快乐,顺便向大家请教一下,如何使gridview像CSDN论坛里的贴子列表一样,onmouseover的时候,颜色渐变?
protected void GVdetail_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#fcf4c2';this.style.cursor='hand'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
这个样子只会一下子改变,不能实现渐变!
protected void GVdetail_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#fcf4c2';this.style.cursor='hand'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
这个样子只会一下子改变,不能实现渐变!
解决方案 »
- ASP.NET 如何对FTP上的文件进行操作
- 在网页上实现播放图片的功能。但是这个功能的间隔的时间在哪里设置..............main.js里面么
- 移动硬盘出问题了,请各位献计策
- DataGrid删除记录弹出对话框的问题.(附代码)
- 最近做一个工程进度管理的项目,b/s 结构,客户端有大量鼠标操作,大虾们能否给点意见?
- 请问彩票网站如何自动更新数据?
- 关于分辨率和网页布局
- 如何屏蔽一些事件,比如autopostback的checkbxo的CheckedChanged事件,在线等
- Treeview控件使用出问题(IEwebcontrols)
- 菜鸟问题:如何重新配置从别的机器拷贝过来的ASP.net程序?
- 大家好,有在苏州那边做.net工作的吗?
- 有关AJAX
http://www.cnblogs.com/Dicky/archive/2006/12/30/607988.html
5楼的,那得写个CSS然后控制CSS变换就可以了,我觉得它颜色从淡到深有个时间,光CSS可能还不行,应该也用到了JS,不知道怎么写
<style>
.rowsActive{background:#fcf4c2;cursor=hand}
.rows{background:#ccc}
</style> e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.className='rowsActive'");
e.Row.Attributes.Add("onmouseout", "this.style.className='rows'");
顺便接分
看论坛里的行颜色变化挺漂亮,想学习下呢~以后做的gridview就更好看了
不过看起来这个像是渐变条,不像是颜色由深变浅或由浅变深!
新年快乐,普天同庆