zoukankan      html  css  js  c++  java
  • GridView移动行变色

    1.
            protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e)
            
    {
                
    //if (e.Row.RowType == DataControlRowType.Header)
                
    //{
                
    //    e.Row.Attributes.Add("style", "background-image:url('./HeadImages/headeImage.jpg')");
                
    //}
                if (e.Row.RowType == DataControlRowType.DataRow)
                
    {
                    
    //e.Row.Attributes["onmouseover"] = "ItemOver(this)";
                    e.Row.Attributes.Add("onmouseover""e=this.style.backgroundColor; this.style.backgroundColor='#EEEEEE'");
                    e.Row.Attributes.Add(
    "onmouseout""this.style.backgroundColor=e");
                }

            }

    2.
    e.Row.Attributes["onmouseover"= "ItemOver(this)";
    if (!objbeforeItem)
    {
        
    var objbeforeItem=null;
        
    var objbeforeItembackgroundColor=null;
    }
        
    function ItemOver(obj)
    {
        
    if(objbeforeItem)
        
    {
            objbeforeItem.style.backgroundColor 
    = objbeforeItembackgroundColor;
        }

        objbeforeItembackgroundColor 
    = obj.style.backgroundColor;
        objbeforeItem 
    = obj;
        obj.style.backgroundColor 
    = "#B9D1F3";     
    }
  • 相关阅读:
    POJ2965(The Pilots Brothers' refrigerator)
    POJ1753(Flip Game)
    POJ3253(Fence Repair)
    山东理工大学的训练计划
    loutsScript 常用代码
    《大道至简》读后感
    2019暑第三周
    2019暑第二周
    2019暑第一周
    关于13组作品《TD tree》的使用感想
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/1242230.html
Copyright © 2011-2022 走看看