<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表格过滤器</title>
<script language="javascript" src="../MyfirstjQueryFileWord/jquery-1.10.2.js">
</script>
<script language="javascript">
$(function(){
/*
//第一种方法
$('.a').css('background','#f00');
$('.b').css('background','#f0f');
$('.c').css('background','#00f');
$('.d').css('background','#ff0');
$('.e').css('background','#f0f');
*/
/*
//第二种方法
$('table tr:first').css('background-color','#f00');
$('table tr:last').css('background-color','#f00');
$('table tr:odd').css('background-color','#f00');
*/
$('table tr:even').css('background-color','#f00');
}); /* 当鼠标移到表格上是,当前一行背景变色 */
$(document).ready(function(){
$(".data_list tr td").mouseover(function(){
$(this).parent().find("td").css("background-color","#d5f4fe");
});
})
/* 当鼠标在表格上移动时,离开的那一行背景恢复 */
$(document).ready(function(){
$(".data_list tr td").mouseout(function(){
var bgc = $(this).parent().attr("bg");
$(this).parent().find("td").css("background-color",bgc);
});
}) </script>
</head>
<body>
<center>
<table width="500" border="1" height="500">
<tr>
<td class="a">&nbsp;</td>
</tr>
<tr>
<td class="b">&nbsp;</td>
</tr>
<tr>
<td class="c">&nbsp;</td>
</tr>
<tr>
<td class="d">&nbsp;</td>
</tr>
<tr>
<td class="e">&nbsp;</td>
</tr>
</table>
</center>
</body>
</html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>表格过滤器</title>
<script language="javascript" src="http://files.cnblogs.com/files/caidupingblogs/jquery-1.10.2.js">
</script>
<script language="javascript">
$(function(){
/*
//第一种方法
$('.a').css('background','#f00');
$('.b').css('background','#f0f');
$('.c').css('background','#00f');
$('.d').css('background','#ff0');
$('.e').css('background','#f0f');
*/
/*
//第二种方法
$('table tr:first').css('background-color','#f00');
$('table tr:last').css('background-color','#f00');
$('table tr:odd').css('background-color','#f00');
*/
$('table tr:even').css('background-color','#f00');
});

/* 当鼠标移到表格上是,当前一行背景变色 */
$(document).ready(function(){
$(".data_list tr td").mouseover(function(){
$(this).parent().find("td").css("background-color","#d5f4fe");
});
})
/* 当鼠标在表格上移动时,离开的那一行背景恢复 */
$(document).ready(function(){
$(".data_list tr td").mouseout(function(){
var bgc = $(this).parent().attr("bg");
$(this).parent().find("td").css("background-color",bgc);
});
})

</script>
</head>
<body>
<center>
<table width="500" border="1" height="500">
<tr>
<td class="a"> </td>
</tr>
<tr>
<td class="b"> </td>
</tr>
<tr>
<td class="c"> </td>
</tr>
<tr>
<td class="d"> </td>
</tr>
<tr>
<td class="e"> </td>
</tr>
</table>
</center>
</body>

最新文章

  1. ie a absolute bug
  2. PLSQL不好用,提示ora-12514 错误解决方法
  3. 我心中的核心组件(可插拔的AOP)~第二回 缓存拦截器
  4. jQuery Panorama Viewer – 360度全景展示插件
  5. principal-component-analysis
  6. Mysql学习笔记(六)增删改查
  7. 开源混淆工具ProGuard配置详解及配置实例
  8. 文档在线预览开源实现方案一:OpenOffice + SwfTools + FlexPaper
  9. nodejs笔记1 ----关于express不是本地命令
  10. linux 安装wordpress 无故往外发送大量垃圾邮件
  11. parse_str 与 http_build_query的使用
  12. session 存到memcache里
  13. 20165228《网络对抗技术》Exp0 Kali安装 Week1
  14. Vue数据交互
  15. 51Nod - 1228 序列求和 (自然数幂和+伯努利数)
  16. 第28月第23天 lineFragmentPadding
  17. [原]openstack-kilo--issue(十)ERROR: openstack Unable to establish connection to http://controller:35357/v3/auth/tokens
  18. oracle查询语句查询增加一列内容
  19. jQuery基础笔记(5)
  20. ORA-28000 账号被锁定的解决办法

热门文章

  1. 【M28】智能指针
  2. 【M11】禁止异常流出析构方法之外
  3. JQuery动画插件Velocity.js发布:更快的动画切换速度
  4. Oracle 数据文件管理
  5. 微信公共服务平台开发(.Net 的实现)11-------客服消息(定项消息推送 重要的OPENID)
  6. android IPC及原理简介
  7. SmartThreadPool
  8. 使用NIO提升性能
  9. itextsharp去掉PDF加密
  10. Python练习题 004:判断某日期是该年的第几天