JavaScript tab Toggle Effect

Source: Internet
Author: User

1<!--2 retain the original author when quoting, respect any original author, promote the Chinese Internet process3 Editor:weasle4Email:[email protected]163. com5Qq:112011531 6-7"http://www.w3.org/1999/xhtml">89<meta http-equiv="Content-type"Content="text/html;charset=gb2312"/>Ten<title> Simple tab</title> One<style type="Text/css"> A<!-- - body,div,ul,li{ -Padding0;  thetext-Align:center; - }  - body{ -font:12px"Song Body";  +text-Align:center; - }  + a:link{ A color: #00F; attext-Decoration:none; - }  - a:visited { - color: #00F; -text-Decoration:none; - }  in a:hover { - color: #c00; totext-Decoration:underline; + }  -ul{list-Style:none;}  the /*Tab 1*/  * #Tab1 { $ width:460px;Panax Notoginseng margin:0px; - padding:0px; theMargin0Auto;}  + /*Tab 2*/  A #Tab2 { the width:576px; + margin:0px; - padding:0px; $Margin0Auto;}  $ /*Menu Class*/  - . Menubox { -Width -%;  theBackground:url (http://www.jb51.net/upload/small/20079299441652.gif);  - height:28px;Wuyiline-height:28px; the }  - . Menubox ul{ Wu margin:0px; - padding:0px; About }  $ . Menubox li{ - float: Left; - Display:block; - Cursor:pointer; A width:114px; +text-Align:center; thecolor:#949694;  -font-Weight:bold; $ }  the . Menubox li.hover{ the padding:0px; the background: #fff; the width:116px; -border-left:1px solid #A8C29F; inborder-top:1px solid #A8C29F; theborder-right:1px solid #A8C29F; theBackground:url (http://www.jb51.net/upload/small/200792994426548.gif);  Aboutcolor:#739242;  thefont-Weight:bold; the height:27px; theline-height:27px; + }  - . contentbox{ the Clear:both;Bayimargin-top:0px; the border:1px solid #A8C29F; theborder-Top:none; - height:181px; -text-Align:center; thepadding-top:8px; the }  the- the</style> -<script> the<!-- the /*The second form of the first form replaces the display style*/  the function Settab (name,cursel,n) {94  for(i=1; i<=n;i++){  the varMenu=document.getelementbyid (name+i);  the varCon=document.getelementbyid ("Con_"+name+"_"+i);  theMenu.classname=i==cursel?"Hover":""; 98Con.style.display=i==cursel?"Block":"None";  About }  - } 101 // -102</script>103104<body> the 106 107  108<div id="TAB1">109<divclass="Menubox"> the<ul>111<li id="one1"onclick="settab (' One ', 1,4)" class="Hover"> News 1</li> the<li id="One2"onclick="settab (' One ', 2,4)"> News 2</li>113<li id="One3"onclick="settab (' One ', 3,4)"> News 3</li> the<li id="one4"onclick="settab (' One ', bis)"> News 4</li> the</ul> the</div>117<divclass="Contentbox">118<div id="Con_one_1" class="Hover"> News list 1</div>119<div id="con_one_2"style="Display:none"> News list 2</div> -<div id="Con_one_3"style="Display:none"> News list 3</div>121<div id="Con_one_4"style="Display:none"> News list 4</div>122</div>123</div>124  the  126<div id="TAB2">127<divclass="Menubox"> -<ul>129<li id="TWO1"onclick="settab (' both ', 1,4)" class="Hover"> News 1</li> the<li id="TWO2"onclick="settab (' both ', 2,4)"> News 2</li>131<li id="Two3"onclick="settab (' both ', 3,4)"> News 3</li> the<li id="Two4"onclick="settab (' both ', bis)"> News 4</li>133</ul>134</div>135<divclass="Contentbox">136<div id="Con_two_1"> News list 1</div>137<div id="con_two_2"style="Display:none"> News list 2</div>138<div id="Con_two_3"style="Display:none"> News list 3</div>139<div id="Con_two_4"style="Display:none"> News list 4</div> $</div>141</div>142</body>

JavaScript tab Toggle 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.