CSS+JS选项卡
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>兼容IE7 IE8 FF 等主流浏览器多标签滑动门</title>
<style type="text/css">
body{
color: #000;
font-family: "宋体", arial;
font-size: 12px;
background: #fff;
text-align: center;
margin: 0;
}
.nTab{
float: left;
width: 542px;
margin: 0 auto;
border-bottom:1px #C7C7CD solid;
background:#d5d5d5;
background-position:left;
background-repeat:repeat-y;
margin-bottom:2px;
}
.nTab .TabTitle{
clear: both;
height: 26px;
overflow: hidden;
}
.nTab .TabTitle ul{
margin:0;
padding:0;
}
.nTab .TabTitle li{
float: left;
width: 60px;
cursor: pointer;
padding-top: 6px;
padding-right: 0px;
padding-left: 0px;
padding-bottom: 7px;
list-style-type: none;
}
.nTab .TabTitle .active{ background:url(/jscss/demoimg/200905/tab_bg1.gif) left -25px no-repeat;border-left:1px #C7C7CD solid;border-top:1px #C7C7CD solid;border-bottom:1px #fff solid;}
.nTab .TabTitle .normal{ background:url(/jscss/demoimg/200905/tab_bg1.gif);border-top:1px #C7C7CD solid;border-bottom:1px #C7C7CD solid;}
.nTab .TabContent{
width:auto;background:#fff;
margin: 0px auto;
padding:10px 0 0 0;
border-right:1px #C7C7CD solid;border-left:1px #C7C7CD solid;
}
.none {display:none;}
</style>
<script type="text/javascript">
function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
if (i == Num)
{
thisObj.className = "active";
document.getElementById(tabObj+"_Content"+i).style.display = "block";
}else{
tabList[i].className = "normal";
document.getElementById(tabObj+"_Content"+i).style.display = "none";
}
}
}
</script>
</head>
<body>
<br />
<center>
<div >
<!-- 选项卡开始 -->
<div class="nTab">
<!-- 标题开始 -->
<div class="TabTitle">
<ul >精品JAVA源码</a></div>
</div>
</div>
<!-- 选项卡结束 --> </div>
</center>
</body>
</html>