<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>最简单的js css Tab 演示 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script language="javascript">
function tabChange(obj,id)
{
var arrayli = obj.parentNode.getElementsByTagName("li"); //获取li数组
var arrayul = document.getElementById(id).getElementsByTagName("ul"); //获取ul数组
for(i=0;i<arrayul.length;i++)
{
if(obj==arrayli[i])
{
arrayli[i].className = "cli";
arrayul[i].className = "";
}
else
{
arrayli[i].className = "";
arrayul[i].className = "hidden";
}
}
}
</script>
<style type="text/css">
.tabbox {width:100%;height:250px;}
.tabmenu {width:100%;height:28px;border-left:1px solid #CCC;border-top:0px solid #ccc;}
.tabmenu ul {margin:0;padding:0;list-style-type: none;}
.tabmenu li { text-align:center; float:left; display:block; width:100px; height:27px; overflow:hidden; background-color: #D2E8F7; line-height:27px; border-right:#ccc 1px solid; border-bottom:#ccc 1px solid; display:inline; font-size:12px;}
.tabmenu .cli {text-align:center;float:left;display:block;width:100px;height:27px;overflow:hidden;background-color: #fff;line-height:27px;border-right:#ccc 1pxsolid;border-bottom:#fff 1px solid;display:inline;font-size:12px; cursor:pointer;}
#tabcontent {width:894px;background-color:#fff;border-left:#CCC 0px solid;border-right:#CCC 0px solid;border-bottom:#CCC 0px solid;}
#tabcontent ul {margin:0;padding:5px;list-style-type: none;}
#tabcontent .hidden {display:none;}
</style>
</head>
<body>
<div class="tabbox">
<div class="tabmenu">
<ul>
<li οnmοuseοver="tabChange(this,'tabcontent')" class="cli">发电厂基础信息</li>
<li οnmοuseοver="tabChange(this,'tabcontent')">发电厂机组信息</li>
<li οnmοuseοver="tabChange(this,'tabcontent')">标签三</li>
<li οnmοuseοver="tabChange(this,'tabcontent')">标签四</li>
<li οnmοuseοver="tabChange(this,'tabcontent')">标签五</li>
</ul>
</div>
<div id="tabcontent">
<ul name="tabul">
<li><a href="#">11111111111111</a></li>
</ul>
<ul class="hidden">
<li><a href="#">2222222222222</a></li>
</ul>
<ul class="hidden">
<li><a href="#">3333333333333</a></li>
</ul>
<ul class="hidden">
<li><a href="#">4444444444444</a></li>
</ul>
<ul class="hidden">
<li><a href="#">5555555555555</a></li>
</ul>
</div>
</div>
</body>
</html>
下面是预览图: