Here, I would like to thank yahoo engineers for selflessly contributing their achievements-yui (yahoo! Ui)
In fact, this is an example of its own. I am just familiar with it. It is more convenient to call various interfaces.
Browse: http://www.healdream.com/upload/html/tabview_test.html
Copy codeThe Code is as follows: <! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
<Head>
<Title> TabView Test </title>
<Link rel = "stylesheet" type = "text/css" href = "tabview1.css">
<Link rel = "stylesheet" type = "text/css" href = "border_tabs1.css">
<Script type = "text/javascript" src = "yahoo. js"> </script>
<Script type = "text/javascript" src = "dom. js"> </script>
<Script type = "text/javascript" src = "event. js"> </script>
<Script type = "text/javascript" src = "tabview. js"> </script>
<Script type = "text/javascript">
Var myTabs = new YAHOO. widget. TabView ("demo ");
YAHOO. example. init = function (){
Var tabView = new YAHOO. widget. TabView ('Demo ');
TabView. on ('contentready', function (){
Obj = document. getElementById ("nav ");
Dest = obj. getElementsByTagName ("li ");
For (var I = 0; I <dest. length; I ++ ){
This. getTab (I). set ('activationevent', 'mouseover ');
}
});
};
YAHOO. example. init ();
</Script>
<Style>
# Demo {
Border: 1px solid #000000;
Width: 40%;
Background-color: # c0c0c0;
Padding: 5px;
}
. Yui-navset.yui-content {
Padding: 10px;
Height: 200px;
}
</Style>
<Div id = "demo" class = "yui-navset">
<Ul class = "yui-nav" id = "nav">
<Li class = "selected"> <a href = "# tab1"> <em> Tab One Label </em> </a> </li>
<Li> <a href = "# tab2"> <em> Tab Two Label </em> </a> </li>
<Li> <a href = "# tab3"> <em> Tab Three Label </em> </a> </li>
</Ul>
<Div class = "yui-content">
<Div> <p> Tab One Content </p> </div>
<Div> <p> Tab Two Content </p> </div>
<Div> <p> Tab Three Content </p> </div>
</Div>
</Div>
Relatively speaking, the code is very refined, compared with other web pages with the same effect