原文发布时间为:2009-05-06 —— 来源于本人的百度文章 [由搬家工具导入]

调用方法如:<tr id="<%# Container.ItemIndex+1 %>" onclick="LightRow(this)" onmouseover=" MouseOverColor(this)" onmouseout="MouseOutColor(this)"
objTr.bgColor,objTr.style.backgroundColor 这两种写法自己选着用

单击背景色改变,再次单击背景色还原
<script type="text/javascript">
var oldid="";
function LightRow(objTr)
{
   var newid=objTr.id;
   if(objTr.bgColor!="#ffe7a7") //进制式颜色不能用大写,要用小写
   {
      objTr.bgColor="#ffe7a7";
      if(oldid!=""&&oldid!=newid)
        document.getElementById(oldid).bgColor="";
      oldid=newid;
    }
    else
    {
       document.getElementById(oldid).bgColor="";//作者:http://hi.baidu.com/handboy
     }
}

function MouseOverColor(objTr)
{
   if(objTr.bgColor!="#ffe7a7")
   {
      objTr.bgColor="AliceBlue";
   }
}
function MouseOutColor(objTr)
{
   if(objTr.bgColor!="#ffe7a7")
   {
      objTr.bgColor="";
   }
}
</script>

单击背景色改变,再次单击背景色不改变
<script type="text/javascript">
    var oldid="";
    function LightRow(objTr)
    {
       var newid=objTr.id;
       if(objTr.style.backgroundColor!="#ffe7a7")
       {
          objTr.style.backgroundColor="#ffe7a7";
          if(oldid!=""&&oldid!=newid)
            (document.getElementById(oldid)).style.backgroundColor="White";
          oldid=newid;
        }
    }

    function MouseOverColor(objTr)
    {
       if(objTr.style.backgroundColor!="#ffe7a7")
       {
         objTr.style.backgroundColor="AliceBlue";
       }
    }
    function MouseOutColor(objTr)
    {
       if(objTr.style.backgroundColor!="#ffe7a7")
       {
          objTr.style.backgroundColor="White";
       }
}

【原创】datalist repeater 控件的行鼠标单击 以及 滑过特效的更多相关文章

  1. MFC小程序003------MFC使用WebBrowser组件,在对话框中创建滚动视图,动态创建一个静态文本控件并设置鼠标单击的消息响应

    MFC小程序截图: 一.在MFC中简单使用WebBrowser的ActiveX插件的方法: 见博文:  http://blog.csdn.net/supermanking/article/detail ...

  2. C#控件之Repeater控件使用

    歡迎大家來討論,修改,一定虛心接受. 1.為什麼使用Repeater控件? 關於把從數據庫讀取的數據綁定到前台頁面,我們可以使用DataGrid.DataGridView以及Repeater來佈局,三 ...

  3. asp.net 在repeater控件中加按钮

    在repeater中加入方法有两种方法: 第一种:是对repeater控件的行添加OnItemCommand事件,添加方法也是有两种 1.在设计页面中,选中repeater控件右击==>属性== ...

  4. asp.net repeater控件操作

    Repeater控件和DataList控件,可以用来一次显示一组数据项.比如,可以用它们显示一个数据表中的所有行. Repeater控件完全由模板驱动,提供了最大的灵活性,可以任意设置它的输出格式. ...

  5. asp.net学习之Repeater控件

    asp.net学习之Repeater控件 文章摘自:http://www.cnblogs.com/shipfi/archive/2009/10/19/1585703.html Repeater控件和D ...

  6. asp.net中Repeater控件用法笔记

    大家可能都对datagrid比较熟悉,但是如果在数据量大的时候,我们就得考虑使用 repeater作为我们的数据绑定控件了.Repeater控件与DataGrid (以及DataList)控件的主要区 ...

  7. Asp.net Repeater控件

    Repeater控件和DataList控件,可以用来一次显示一组数据项.比如,可以用它们显示一个数据表中的所有行.     Repeater控件完全由模板驱动,提供了最大的灵活性,可以任意设置它的输出 ...

  8. Repeater控件的详细用法

    中隔行(交替项)呈现一次.通过设置 AlternatingItemTemplate 元素的样式属性,可以为其指定不同的外观. FooterTemplate在所有数据绑定行呈现之后呈现一次的元素.典型的 ...

  9. 在Repeater控件中使用if语句

    原文:在Repeater控件中使用if语句 .Afr_ARTICLE_TITLE { font: NORMAL BOLD 14px "Tahoma"; } .Afr_CONTENT ...

随机推荐

  1. asp.net 中 UpdataPanel 的使用注意点

    1. 在UpdataPanel 前必须加上asp:ScriptManager的控件,保证页面能够正常显示

  2. Mbps、Kbps、bps、kb、mb区别和换算

    Mbps 即 Milionbit pro second(百万位每秒) Kbps 即 Kilobit pro second(千位每秒) bps 即 bit pro second(位每秒) 速度单位,bi ...

  3. Spring的datasource配置详解【转】

    一句话,Spring对Hibernate的整合,是在applicationContext.xml中配置sessionFactory来实现的,其中sessionFactory中要装配dataSource ...

  4. oracle 事务 锁机制

    原文地址:http://www.cnblogs.com/quanweiru/archive/2013/05/24/3097367.html 本课内容属于Oracle高级课程范畴,内容略微偏向理论性,但 ...

  5. printf("\033[1;33m ***** \033[0m \n");

    printf("\033[1;33m Hello World. \033[0m \n"); 颜色如下: none = "\033[0m" black = &qu ...

  6. String使用方法详解

    标准c++中string类函数介绍 注意不是CString 之所以抛弃char*的字符串而选用C++标准程序库中的string类,是因为他和前者比较起来,不必 担心内存是否足够.字符串长度等等,而且作 ...

  7. Reachability from the Capital

    题目描述 There are nn cities and mm roads in Berland. Each road connects a pair of cities. The roads in ...

  8. KMP的正确使用法_x新疆网络赛Query on a string

    Query on a string 题意,给定一个大字符串,给定一个小模式串,定义 两种不同的任务模式,分别是查询和更改: 查询对应区间内,有多少个匹配到位的数字: 修改某一位的某一个字母. 于是直觉 ...

  9. 手机注册过哪些网站37kfenxi.com,查询注册过哪些网站

    注册过哪些网站?发现这么一个网站,https://www.37kfenxi.com?_=cnblogs 可以根据手机号码查询注册过哪些网站,然后通过大数据分析出机主的性格,爱好等. 据说还可以查老板, ...

  10. OpenCV学习笔记(五) 文件存取

    转自输入输出XML和YAML文件 To be filled