Use YUI to make a tag browsing Effect

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.