复制代码代码如下:
<!
<head>
<meta http-equiv = "content-type" content = "text /html; charset = gb2312" />
<Title> 点击切换和自动切换选项卡 </title>
<style type = "text/css">
*{estilo de lista: nenhum; margem: 0; preenchimento: 0; transbordamento: oculto}
.tab1 {width: 401px; border-top:#a8c29f sólido 1px; borda-fundo:#a8c29f sólido 1px; margem: 50px 200px;}
.Menu {Width: 400px; Antecedentes: #eee; altura: 28px; direita de borda:#a8c29f sólido 1px; fundo de borda:#a8c29f sólido 1px;}
li {float: esquerda; largura: 99px; text-align: centro; altura da linha: 28px; altura: 28px; cursor: ponteiro; borda-esquerda:#a8c29f sólido 1px; cor:#666; font-size: 14px; Overflow: oculto}
.Menudiv {Width: 399px; Hight: 300px; borda-esquerda:#a8c29f sólido 1px; direita de borda:#a8c29f sólido 1px; borda: 0; fundo: #fefe}
.Menudiv Div {Padding: 15px; altura da linha: 28px;}
.off {background:#e0e2eb; cor:#336699; font-weight: Bold}
</style>
<script type = "text/javascript">
Função Settab (Nome, Cursel) {
Cursel_0 = Cursel;
for (var i = 1; i <= links_len; i ++) {
var menu = document.getElementById (nome+i);
var menudiv = document.getElementById ("CON _"+nome+"_"+i);
if (i == Cursel) {
MENU.CLASSNAME = "OFF";
menudiv.style.display = "bloco";
}
outro{
MENU.CLASSNAME = "";
menudiv.style.display = "nenhum";
}
}
}
função a seguir () {
cursel_0 ++;
if (Cursel_0> links_len) Cursel_0 = 1
Settab (name_0, Cursel_0);
}
var name_0 = 'One';
var cursel_0 = 1;
var links_len, iintervalid;
OnLoad = function () {
var links = document.getElementById ("tab1"). getElementsByTagName ('li')
links_len = links.length;
for (var i = 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>
<div id = "tab1">
<div>
<ul>
<li id = "One1" onclick = "Settab ('One', 1)"> 标签 1 </li>
<li id = "One2" onclick = "Settab ('One', 2)"> 标签 2 </li>
<li id = "One3" onclick = "Settab ('One', 3)"> 标签 3 </li>
<li id = "One4" onclick = "Settab ('One', 4)"> 标签 4 </li>
</ul>
</div>
<div>
<div id = "con_one_1"> <h4 style = "cor: vermelho"> 标签 1- 内容 </h4> </div>
<div id = "con_one_2" style = "display: nenhum;"> <h4 style = "cor: vermelho"> 标签 2- 内容 </h4> </div>
<div id = "con_one_3" style = "display: nenhum;"> <h4 style = "cor: vermelho"> 标签 3- 内容 </h4> </div>
<div id = "con_one_4" style = "display: nenhum;"> <h4 style = "cor: vermelho"> 标签 4- 内容 </h4> </div>
</div>
</div>
</body>