原文发布时间为: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. Python通过RabbitMQ实现RPC

    Client端代码: #!/usr/bin/env python # -*- coding:utf-8 -*- import pika import uuid import time class Fi ...

  2. win 系统下制作U盘安装 linux系统

    win 系统制作U盘安装硬盘镜像用ultraiso_v9.5.3.2901将Centos.iso写进U盘.安装过程全程区分大小写.过低的ultraiso不能正确读取文件.本文所有资料均能在网上免费下载 ...

  3. poj 23565-Find a multiple

    Find a multiple The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each ...

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

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

  5. Maya

    建立酒杯的方法(CV曲线) surface(曲面)-- creat cv curve tool-- control vertex(调整图形)[再次creat cv建立厚度,只需要建立酒杯的上口]--- ...

  6. C# datagridview列绑定类中类的属性

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://www.cnblogs.com/linghaoxinpian/p/5906374. ...

  7. VC下如何调用控制台命令以及其他可执行文件

    开始的时候想写一个基于MFC的Wifi开关控制程序,可是不知道VC中如何调用控制台命令,经过网上的学习,发现其实挺挺简单也挺好用.于是制作了一个简单的基于MFC个人助理小软件,可以点击按钮实现Wifi ...

  8. Careercup - Microsoft面试题 - 24313662

    2014-05-12 07:27 题目链接 原题: Convert a number to a number 题目:把二进制数转化成四进制数. 解法:四是二的倍数,所以两位变一位就可以了. 代码: / ...

  9. 【palindrome partitioning II】cpp

    题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return ...

  10. 【转载】zookeeper使用和原理探究(一)

    最近开始看到一些公司在使用zookeeper,本身对此了解的很少,这里看到一篇非常好的文章,因此转载 原贴地址:http://www.blogjava.net/BucketLi/archive/201 ...