<script type="text/javascript">
//获取Repeater的每一行
var oItems = document.getElementsByClassName("item"); //循环为每一行绑定事件
for (var i = ; i < oItems.length; i++) {
//鼠标悬浮时判断背景色
oItems[i].onmouseover = function () {
if (this.style.backgroundColor == "white")
this.style.backgroundColor = "yellow";
}; //鼠标移除时判断背景色
oItems[i].onmouseout = function () {
if (this.style.backgroundColor == "yellow") {
this.style.backgroundColor = "white";
}
}; //点击时事件
oItems[i].onclick = function () {
//将所有行背景色变为白色
for (var j = ; j < oItems.length; j++) {
oItems[j].style.backgroundColor = "white";
}
//将点击的行背景色变为红色
this.style.backgroundColor = "red";
};
} </script>

最新文章

  1. 如何在Linux上使用文件作为内存交换区(Swap Area)
  2. .NET (二)委托第二讲:内置委托Func
  3. 解读Unity中的CG编写Shader系列二
  4. MFC 打开其他程序
  5. js小效果-全选
  6. BZOJ2102 : [Usaco2010 Dec]The Trough Game
  7. SVM(支持向量机)与统计机器学习 &amp; 也说一下KNN算法
  8. Java Concurrency - ReadWriteLock &amp; ReentrantReadWriteLock
  9. LA3942-Remember the Word(Trie)
  10. css 雪碧图 及jquery定位代码
  11. sql server2008如何创建外键
  12. 提高你开发效率的十五个Visual Studio 2010使用技巧
  13. How to initialize a static const map in c++?
  14. BotVS开发基础—2.3 下市价单 交易
  15. 【转】C#中判断网址是否有效
  16. Python随笔--魔法方法(析构与构造)
  17. window.onload和document.ready
  18. 【译】Surface中你也许不知道的五件事
  19. Android工具类-关于网络、状态的工具类
  20. 前端思想实现:面向UI编程_____前端框架设计开发

热门文章

  1. c语言寄存器变量
  2. springboot中开发热部署(devtools)
  3. 快速完成网页设计,10个顶尖响应式HTML5网页模板助你一臂之力
  4. oracle 建立表空间和用户
  5. nancy 中的json问题
  6. [LeetCode 题解]: Rotate List
  7. hadoop 2.7.3伪分布式安装
  8. WPF上下滚动字幕
  9. WPF 降低.net framework到4.0
  10. WPF WindowStyle为None