表格隔行换色鼠标感应变色效果

2个月前 (03-17 11:38)阅读43回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值4114
  • 级别管理员
  • 主题822
  • 回复2
楼主

这是一种常用的表格隔行换色特效,表格列表隔行换色,鼠标经过时背景眼色加亮显示,自定义颜色代码。

<!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=gb2312">
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>表格隔行换色鼠标感应变色效果_武鸣人</title>
<style type="text/css">
.eee{ background:#eee;}
.ddd{ background:#ddd;}
.on{ background:#f60}
.click{ background:#333;color:#fff;}
</style>
</head>
<body>
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td>武鸣人一号内容</td>
  </tr>
  <tr>
    <td>武鸣人二号内容</td>
  </tr>
  <tr>
    <td>武鸣人三号内容</td>
  </tr>
  <tr>
    <td>武鸣人四号内容</td>
  </tr>
  <tr>
    <td>武鸣人五号内容</td>
  </tr>
  <tr>
    <td>武鸣人六号内容</td>
  </tr>
  <tr>
    <td>武鸣人七号内容</td>
  </tr>
  <tr>
    <td>武鸣人八号内容</td>
  </tr>
  <tr>
    <td>武鸣人九号内容</td>
  </tr>
</table>
<script language="javascript">
window.onload=function(){
var trs = document.getElementsByTagName('tr');
for(var i=0; i<trs.length; i++){
trs[i].className=(i%2==0)?"eee":"ddd";
trs[i].onclick=function(){
for(var i=0;i<trs.length;i++){
if(trs[i].className == 'click' && trs[i]!=this){
trs[i].className=(i%2==0)?"eee":"ddd";
}
}
this.className = (this.className!='click')?'click':((firePos(trs,this)%2==0)?"eee":"ddd");
}
trs[i].onmouseover=function(){
if(this.className=='click'){}
else this.className = 'on';
}
trs[i].onmouseout=function(){
if(this.className=='click'){}
else this.className=(firePos(trs,this)%2==0)?"eee":"ddd";
}
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function firePos(al,curr){
for(var i=0; i<al.length; i++){
if(al[i]==curr) return i;
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script>
</body>
</html>


0
0
收藏0
回帖

表格隔行换色鼠标感应变色效果 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息