<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>点击切换和自动切换选项卡</title>
<styletype="text/css">
*{list-style:none;margin:0;padding:0;overflow:hidden}
.tab1{width:401px;border-top:#A8C29Fsolid1px;border-bottom:#A8C29Fsolid1px;margin:50px200px;}
.menu{width:400px;background:#eee;height:28px;border-right:#A8C29Fsolid1px;border-bottom:#A8C29Fsolid1px;}
li{float:left;width:99px;text-align:center;line-height:28px;height:28px;cursor:pointer;border-left:#A8C29Fsolid1px;color:#666;font-size:14px;overflow:hidden}
.menudiv{width:399px;height:300px;border-left:#A8C29Fsolid1px;border-right:#A8C29Fsolid1px;border-top:0;background:#fefefe}
.menudivdiv{padding:15px;line-height:28px;}
.off{background:#E0E2EB;color:#336699;font-weight:bold}
</style>
<scripttype="text/javascript">
functionsetTab(name,cursel){
cursel_0=cursel;
for(vari=1;i<=links_len;i++){
varmenu=document.getElementById(name+i);
varmenudiv=document.getElementById("con_"+name+"_"+i);
if(i==cursel){
menu.className="off";
menudiv.style.display="block";
}
else{
menu.className="";
menudiv.style.display="none";
}
}
}
functionNext(){
cursel_0++;
if(cursel_0>links_len)cursel_0=1
setTab(name_0,cursel_0);
}
varname_0='one';
varcursel_0=1;
varlinks_len,iIntervalId;
onload=function(){
varlinks=document.getElementById("tab1").getElementsByTagName('li')
links_len=links.length;
for(vari=0;i<links_len;i++){
links[i].onmouseover=function(){
clearInterval(iIntervalId);
}
}
document.getElementById("con_"+name_0+"_"+links_len).parentNode.onmouseover=function(){
clearInterval(iIntervalId);
}
setTab(name_0,cursel_0);
}
</script>
</head>
<body>
<h3></h3>
<divclass="tab1"id="tab1">
<divclass="menu">
<ul>
<liid="one1"onclick="setTab('one',1)">标签1</li>
<liid="one2"onclick="setTab('one',2)">标签2</li>
<liid="one3"onclick="setTab('one',3)">标签3</li>
<liid="one4"onclick="setTab('one',4)">标签4</li>
</ul>
</div>
<divclass="menudiv">
<divid="con_one_1"><h4style="color:red">标签1-内容</h4></div>
<divid="con_one_2"style="display:none;"><h4style="color:red">标签2-内容</h4></div>
<divid="con_one_3"style="display:none;"><h4style="color:red">标签3-内容</h4></div>
<divid="con_one_4"style="display:none;"><h4style="color:red">标签4-内容</h4></div>
</div>
</div>
</body>