Click the Label Switch and switch the DIV tab to switch the div

Source: Internet
Author: User

Click the Label Switch and switch the DIV tab to switch the div

Copy codeThe Code is as follows:
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> click the switch and automatic switch tabs </title>
<Style type = "text/css">
* {List-style: none; margin: 0; padding: 0; overflow: hidden}
. Tab1 {width: 401px; border-top: # A8C29F solid 1px; border-bottom: # A8C29F solid 1px; margin: 50px 200px ;}
. Menu {width: 400px; background: # eee; height: 28px; border-right: # A8C29F solid 1px; border-bottom: # A8C29F solid 1px ;}
Li {float: left; width: 99px; text-align: center; line-height: 28px; height: 28px; cursor: pointer; border-left: # A8C29F solid 1px; color: #666; font-size: 14px; overflow: hidden}
. Menudiv {width: 399px; height: 300px; border-left: # A8C29F solid 1px; border-right: # A8C29F solid 1px; border-top: 0; background: # fefefefe}
. Menudiv div {padding: 15px; line-height: 28px ;}
. Off {background: # E0E2EB; color: #336699; font-weight: bold}
</Style>
<Script type = "text/javascript">
Function setTab (name, cursel ){
Cursel_0 = cursel;
For (var I = 1; I <= links_len; I ++ ){
Var menu = document. getElementById (name + I );
Var menudiv = document. getElementById ("con _" + name + "_" + I );
If (I = cursel ){
Menu. className = "off ";
Menudiv. style. display = "block ";
}
Else {
Menu. className = "";
Menudiv. style. display = "none ";
}
}
}
Function Next (){
Cursel_0 ++;
If (cursel_0> links_len) cursel_0 = 1
SetTab (name_0, cursel_0 );
}
Var name_0 = 'one ';
Var cursel_0 = 1;
Var links_len, iIntervalId;
Onload = function (){
Var links = document. getElementById ("tab1"). getElementsByTagName ('lil ')
Links_len = links. length;
For (var I = 0; I <links_len; I ++ ){
Links [I]. onmouseover = function (){
ClearInterval (iIntervalId );
}
}
Document. getElementById ("con _" + name_0 + "_" + links_len). parentNode. onmouseover = function (){
ClearInterval (iIntervalId );
}
SetTab (name_0, cursel_0 );
}
</Script>
</Head>
<Body>
<H3> <Div class = "tab1" id = "tab1">
<Div class = "menu">
<Ul>
<Li id = "one1" onclick = "setTab ('one', 1)"> tag 1 </li>
<Li id = "one2" onclick = "setTab ('one', 2)"> tag 2 </li>
<Li id = "one3" onclick = "setTab ('one', 3)"> tag 3 </li>
<Li id = "one4" onclick = "setTab ('one', 4)"> tag 4 </li>
</Ul>
</Div>
<Div class = "menudiv">
<Div id = "con_one_1">

<Div id = "con_one_2" style = "display: none;">

<Div id = "con_one_3" style = "display: none;">

<Div id = "con_one_4" style = "display: none;">

</Div>
</Div>
</Body>


How does Maxthon2 automatically switch the new tab to the new tab?

Khan ...... I'm not doing anything about it. If it's me, I will choose to load the proud game (including configuration data) and reload the proud game.

Supplement: after the check box is checked, pull the scroll bar to the top and there will be an "application" on it. It will take effect only after you click the application.

Tool -- Option-Maxthon option-tab bar-there is a "mouse click and Shift + Click" in the "Activate new tag" column to check and click the application above.

The page switch code requires div + css

<! DOCTYPE html>  

Related Article

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.