Tab page card effect !, Tab
The most common problem is that a single interface needs to display a lot of content, so pages must be displayed separately, but other drag controls are integrated, leading to invalid tab controls such as jquery, or an error is returned from the original script after jquery is imported. So I found a handwritten share:
First take a look:
: // Www.w3.org/5o/xhtml ">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> concise Tab </title>
<Style type = "text/css">
<! --
Body, div, ul, li {
Padding: 0;
Text-align: center;
}
Body {
Font: 12px "";
Text-align: center;
}
Ul {list-style: none ;}
/* Tab 1 */
# Tab1 {
Width: 100%;
Margin: 0px;
Padding: 0px;
Margin: 0 auto ;}
/* Tab 2 */
# Tab2 {
Width: 576px;
Margin: 0px;
Padding: 0px;
Margin: 0 auto ;}
/* Menu class */
. Menubox {
Width: 100%;
Background: url (http://www.jb51.net/upload/small/20079299441652.gif );
Height: 28px;
Line-height: 28px;
}
. Menubox ul {
Margin: 0px;
Padding: 0px;
}
. Menubox li {
Float: left;
Display: block;
Cursor: pointer;
Width: 114px;
Text-align: center;
Color: #949694;
Font-weight: bold;
}
. Menubox li. hover {
Padding: 0px;
Background: # fff;
Width: pixel PX;
Border-left: 1px solid # A8C29F;
Border-top: 1px solid # A8C29F;
Border-right: 1px solid # A8C29F;
Background: url (http://www.jb51.net/upload/small/200792994426548.gif );
Color: #739242;
Font-weight: bold;
Height: 27px;
Line-height: 27px;
}
. Contentbox {
Clear: both;
Margin-top: 0px;
Border: 1px solid # A8C29F;
Border-top: none;
Height: 181px;
Text-align: center;
Padding-top: 8px;
}
-->
</Style>
<Script>
<! --
/* Change the display style in the first and second forms */
Function setTab (name, cursel, n ){
For (I = 1; I <= n; I ++ ){
Var menu = document. getElementById (name + I );
Var con = document. getElementById ("con _" + name + "_" + I );
Menu. className = I = cursel? "Hover ":"";
Con. style. display = I = cursel? "Block": "none ";
}
}
// -->
</Script>
</Head>
<Body>
<Div id = "Tab1">
<Div class = "Menubox">
<Ul>
<Li id = "one1" onClick = "setTab ('one', 1, 2)" class = "hover"> News 1 </li>
<Li id = "one2" onClick = "setTab ('one', 2, 2)"> News 2 </li>
</Ul>
</Div>
<Div class = "Contentbox">
<Div id = "con_one_1" class = "hover"> News list 1 </div>
<Div id = "con_one_2" style = "display: none"> News list 2 </div>
</Div>
</Div>
</Body>