zoukankan      html  css  js  c++  java
  • jQuery改变GridView的样式

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            
    if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add(
    "onmouseover""c=this.style.backgroundColor;this.style.backgroundColor='#B9D3EE'");
                e.Row.Attributes.Add(
    "onmouseout""this.style.backgroundColor=c");
            }
        }

     也可以利用JQUERY实现相关的功能

                //变色
                $("tr").filter(function(){
                    
    return $('td',this).length && !$('table',this).length
                 }).css({ background:
    "ffffff" }).hover(
                        
    function(){$(this).css({background:"#C1DAD7"});},
                        
    function(){$(this).css({background:"#ffffff"});}
                 );

     实例代码

  • 相关阅读:
    团队开发-第一阶段冲刺-10
    团队开发-第一阶段冲刺-09
    Spring(三)
    第五周总结
    Spring(一)
    程序员修炼之道:从小工到专家阅读笔记1
    MyBatis(三)
    MyBatis(二)
    MyBatis
    第四周总结
  • 原文地址:https://www.cnblogs.com/chenqingwei/p/1689808.html
Copyright © 2011-2022 走看看