大家牛年快乐,顺便向大家请教一下,如何使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");
            }
        }
这个样子只会一下子改变,不能实现渐变!

解决方案 »

  1.   

    那得写个CSS然后控制CSS变换就可以 了
      

  2.   

    写个CSS实现
    http://www.cnblogs.com/Dicky/archive/2006/12/30/607988.html
      

  3.   

    6楼的,没见到这种效果吗?这论坛里就是这样的哦。鼠标移过,行颜色变化
    5楼的,那得写个CSS然后控制CSS变换就可以了,我觉得它颜色从淡到深有个时间,光CSS可能还不行,应该也用到了JS,不知道怎么写
      

  4.   

    定义两个css
    <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'"); 
      

  5.   

    style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#0B6CCB,endColorStr=#FFFFFF);"css实现,不过大多这种css在firefox下不起作用!
      

  6.   

     用setInterval 逐步加深吧 呵呵
     顺便接分
      

  7.   

    up 新年快乐对css样式的控制应该可以 我也没见过-,-
      

  8.   

    类似的,鼠标移开时,gridview行颜色几秒内由深变浅,CSS控制不了时间的吧?
    看论坛里的行颜色变化挺漂亮,想学习下呢~以后做的gridview就更好看了
      

  9.   

    这位朋友的style是渐变条吗?我这页好像用不了FILTER: progid:意外的字符
    不过看起来这个像是渐变条,不像是颜色由深变浅或由浅变深!
      

  10.   

    css实现吧,滤镜
    新年快乐,普天同庆