<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.111cn.net/1999/xhtml">
<Head>
<Title> </title>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<Style type = "text/css tutorial">
* {Margin: 0; padding: 0 ;}
Body {line-height: 22px}
. Current {background: # f60; color: # fff}
Dl {overflow: hidden; zoom: 1; margin-bottom: 30px}
Dd {float: left; width: 100px; text-align: center; list-style: none; cursor: pointer ;}
Li {display: none ;}
</Style>
</Head>
<Body>
<Dl id = "nav">
<Dd> Menu 1 </dd>
<Dd> Menu 2 </dd>
<Dd> menu 3 </dd>
<Dd> menu 4 </dd>
<Dd class = "current"> Menu 5 </dd>
</Dl>
<Ul id = "bb">
<Li style = "display: block"> Content 1 </li>
<Li> content 2 </li>
<Li> Content 3 </li>
<Li> Content 4 </li>
<Li> Content 5 </li>
</Ul>
<Script language = "javascript tutorial">
Function tabs (e1, e2 ){
Var tag1 = "dd", tag2 = "li", addclass = "current", checkNav = "", checkWrap = "";
Var o1 = document. getElementById (e1), o2 = document. getElementById (e2), ElementNav = new Array (); ElementWrap = new Array ();
Chk = function (e, n) {var v = eval ("/" + n + "/gi"); if (v = undefined) {return true} else if (v. test (e. className) {return true };}
Function ser (e, arr, g, n ){
Var tags = e. getElementsByTagName (g), v = 0;
For (I = 0; I <tags. length; I ++ ){
If (chk (tags [I], n) = true) {arr [v] = tags [I]; v ++ ;};
}
}
Function Start (e, f ){
Var s = e. length;
For (I = 0; I <s; I ++ ){
E [I]. onmouseover = function () {mOver (this )}
}
Function mOver (obj ){
For (var I = 0; I <s; I ++ ){
F [I]. style. display = "none ";
E [I]. className = "";
}
For (var I = 0; I <s; I ++ ){
If (e [I] = obj) {f [I]. style. display = "block"; e [I]. className = addclass}
}
}
}
Ser (o1, ElementNav, tag1, checkNav );
Ser (o2, ElementWrap, tag2, checkWrap );
Start (ElementNav, ElementWrap)
}
Tabs ("nav", "bb ")
</Script>
</Body>
</Html>