The following provides a jquery fade-in and fade-out tab effect code, this article does not provide jquery files, you can go to google or down. bKjia. c0m to download the jquery-1.4.2.min.js file.
The following provides a jquery fade-in and fade-out tab effect code, this article does not provide jquery files, you can go to google or down. bKjia. c0m download jquery-1.4.2.min. Web effects files.
<! 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> simple and practical tab menu </title>
<Meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<! -- Add the following code between <Style type = "text/css tutorial">
Ul, li {margin: 0; padding: 0; list-style: none ;}
# Tabfirst li {float: left; background-color: #868686; color: white; padding: 5px; margin-right: 2px; border: 1px solid white ;}
# Tabfirst li. tabin {background-color: # 6e6e6e; border: 1px solid # 6e6e6e ;}
. Contentfirst {clear: left; background-color: # 6e6e6e; color: white; width: 300px; height: 100px; padding: 10px; display: none ;}
. Contentin {display: block ;}
</Style>
<Script type = "text/Webpage effects" src = "/jquery-1.4.2.min.js"> </script>
<Script type = "text/javascript">
$ (Function (){
Var _ tab = $ ('ul # tabfirst> li ');
Var _ con = $ ('div # tab_box> div ');
Var _ conthis;
Var _ index = 0;
_ Tab. click (function (){
_ Index = _ tab. index (this );
$ (This). addclass ('tabin'). siblings (). removeclass ('tabin ');
_ Con. filter (': visable'). stop (true, true). fadeout (200, function (){
_ Con. eq (_ index). fadein (200)
})
});
})
</Script>
</Head>
<Body>
An error is prompted in the lower left corner of the preview result, and the effect is invisible. Refresh the page to see the effect. Of course, this problem does not occur in actual use. <Br>
<! -- Add the following code to the <body> and </body> -->
<Ul id = "tabfirst">
<Li class = "tabin"> label 1 </li>
<Li> label 2 </li>
<Li> label 3 </li>
</Ul>
<Div id = "tab_box">
<Div class = "contentin contentfirst"> content 1 </div>
<Div class = "contentfirst"> content 2 </div>
<Div class = "contentfirst"> content 3 </div>
</Div>
</Body>
</Html>