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"});}
                 );

     实例代码

  • 相关阅读:
    第十一周上机练习
    JAVA第十周上机练习
    JAVA第九周上机练习
    JAVA第八周作业
    JAVA第八周上机作业
    JAVA第七周作业
    Java第七周上机练习
    Java第六周作业
    JAVA第六周上机练习
    34-指针与二维数组
  • 原文地址:https://www.cnblogs.com/chenqingwei/p/1689808.html
Copyright © 2011-2022 走看看