【原创】datalist repeater 控件的行鼠标单击 以及 滑过特效
原文发布时间为: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 控件的行鼠标单击 以及 滑过特效的更多相关文章
- MFC小程序003------MFC使用WebBrowser组件,在对话框中创建滚动视图,动态创建一个静态文本控件并设置鼠标单击的消息响应
MFC小程序截图: 一.在MFC中简单使用WebBrowser的ActiveX插件的方法: 见博文: http://blog.csdn.net/supermanking/article/detail ...
- C#控件之Repeater控件使用
歡迎大家來討論,修改,一定虛心接受. 1.為什麼使用Repeater控件? 關於把從數據庫讀取的數據綁定到前台頁面,我們可以使用DataGrid.DataGridView以及Repeater來佈局,三 ...
- asp.net 在repeater控件中加按钮
在repeater中加入方法有两种方法: 第一种:是对repeater控件的行添加OnItemCommand事件,添加方法也是有两种 1.在设计页面中,选中repeater控件右击==>属性== ...
- asp.net repeater控件操作
Repeater控件和DataList控件,可以用来一次显示一组数据项.比如,可以用它们显示一个数据表中的所有行. Repeater控件完全由模板驱动,提供了最大的灵活性,可以任意设置它的输出格式. ...
- asp.net学习之Repeater控件
asp.net学习之Repeater控件 文章摘自:http://www.cnblogs.com/shipfi/archive/2009/10/19/1585703.html Repeater控件和D ...
- asp.net中Repeater控件用法笔记
大家可能都对datagrid比较熟悉,但是如果在数据量大的时候,我们就得考虑使用 repeater作为我们的数据绑定控件了.Repeater控件与DataGrid (以及DataList)控件的主要区 ...
- Asp.net Repeater控件
Repeater控件和DataList控件,可以用来一次显示一组数据项.比如,可以用它们显示一个数据表中的所有行. Repeater控件完全由模板驱动,提供了最大的灵活性,可以任意设置它的输出 ...
- Repeater控件的详细用法
中隔行(交替项)呈现一次.通过设置 AlternatingItemTemplate 元素的样式属性,可以为其指定不同的外观. FooterTemplate在所有数据绑定行呈现之后呈现一次的元素.典型的 ...
- 在Repeater控件中使用if语句
原文:在Repeater控件中使用if语句 .Afr_ARTICLE_TITLE { font: NORMAL BOLD 14px "Tahoma"; } .Afr_CONTENT ...
随机推荐
- Windows CMD命令 查看无线密码
netsh wlan show profiles netsh wlan show profiles name='无线网络名称' key=clear
- Redux百行代码千行文档
接触Redux不过短短半年,从开始看官方文档的一头雾水,到渐渐已经理解了Redux到底是在做什么,但是绝大数场景下Redux都是配合React一同使用的,因而会引入了React-Redux库,但是正是 ...
- JS的四舍五入问题
最近踩了一个坑,mark一下toFixed四舍五入问题,详见代码: var myFixed = function(num, fix) { num = (parseFloat(num) * + ) / ...
- HDU 1423 Greatest Common Increasing Subsequence(LCIS)
Greatest Common Increasing Subsequenc Problem Description This is a problem from ZOJ 2432.To make it ...
- Broken robot CodeForces - 24D (概率DP)
You received as a gift a very clever robot walking on a rectangular board. Unfortunately, you unders ...
- Linux命令之---pwd
命令简介 Linux中用 pwd 命令用来查看”当前工作目录“的完整路径. 命令格式 pwd [选项] 命令功能和参数 功能:查看”当前工作目录“的完整路径:参数:一般情况下不带任何参数,如果目录是链 ...
- 数据库sql中distinct用法注意事项
在写sql中去重复等操作,需要用到distinct. 在使用distinct的时候要注意,尤其是在有行列转换的时候.要把sql运行出来看看是不是与你想要的结果一样. 通过自己试验,distinct有从 ...
- lua table长度解析
先来看lua table源码长度获取部分(ltable.c) j是数组部分的长度.首先判断数组长度大于0,并且数组最后一个是nil,就用二分法查找,返回长度. 如果t->node是 table的 ...
- 精简Docker镜像的五种通用方法
http://dockone.io/article/8163 精简Docker镜像的好处很多,不仅可以节省存储空间和带宽,还能减少安全隐患.优化镜像大小的手段多种多样,因服务所使用的基础开发语言不同而 ...
- 37、iamgeview 图层叠加
1 Drawable d1 = new BitmapDrawable(circleBitmap); Drawable d2 = login.this.getResources().getDrawabl ...