<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> multiple tabs created by jquery _ webpage code station (www.webdm.cn) </title>
<Script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"> </script>
<Script type = "text/javascript">
$ (Function (){
Var wweya_li = $ ("div. tab_menu ul li ");
Wweya_li.click (function (){
$ (This). addClass ("selected") // highlight the current <li> element
. Siblings (). removeClass ("selected"); // remove the highlight of <li> elements of other peers
Var index = wweya_li.index (this); // obtain the index of the currently clicked <li> element in all li elements.
$ ("Div. tab_box> div") // select a subnode. If you do not select a subnode, an error occurs. If there is a div inside
. Eq (index). show (100) // display the <div> element corresponding to the <li> element
. Siblings (). hide (); // hide <div> element} of several other peers). hover (function (){
$ (This). addClass ("hover ");
}, Function (){
$ (This). removeClass ("hover ");
})
})
</Script>
<Style type = "text/css">
* {Margin: 0; padding: 0 ;}
Body {font: 12px/19px Arial, Helvetica, sans-serif; color: #666 ;}
. Tab {width: 240px; margin: 50px ;}
. Tab_menu {clear: both ;}
. Tab_menu li {float: left; text-align: center; cursor: pointer; list-style: none; padding: 1px 6px; margin-right: 4px; background: # F1F1F1; border: 1px solid #898989; border-bottom: none ;}
. Tab_menu li. hover {background: # DFDFDF ;}
. Tab_menu li. selected {color: # FFF; background: #6D84B4 ;}
. Tab_box {clear: both; border: 1px solid #898989; height: 100px ;}
. Hide {display: none}
H1 {margin: 80px; line-height: 90px; font-size: 16px; color: #999; text-align: center; border-top: 1px solid # ddd ;}
</Style>
</Head>
<Body>
<Div class = "tab">
<Div class = "tab_menu">
<Ul>
<Li class = "selected"> constellation </li>
<Li> fashion </li>
<Li> entertainment </li>
</Ul>
</Div>
<Div class = "tab_box">
<Div> Pisces </div>
<Div class = "hide"> fashion trends </div>
<Div class = "hide"> Entertainment gossip </div>
</Div>
<Div class = "tab_menu">
<Ul>
<Li class = "selected"> constellation </li>
<Li> fashion </li>
<Li> entertainment </li>
</Ul>
</Div>
<Div class = "tab_box">
<Div> Pisces </div>
<Div class = "hide"> fashion trends </div>
<Div class = "hide"> Entertainment gossip </div>
</Div>
</Div>
<P> </p>
<P> it can be infinite, but must be paired. </p>
<P> </p>
<Div class = "tab_menu">
<Ul>
<Li class = "selected"> constellation </li>
<Li> fashion </li>
<Li> entertainment </li>
</Ul>
</Div>
<Div class = "tab_box">
<Div> Pisces </div>
<Div class = "hide"> fashion trends </div>
<Div class = "hide"> Entertainment gossip </div>
</Div>
<H1> by <a href = "/" target = "_ blank"> website code </a>
<Br/>
<P> <a href = "http://www.webdm.cn"> Web code site </a>-the most professional web code download site-is committed to providing quality web code for Chinese webmasters! </P>
</Body>
</Html>