Tab Toggle Effect

Source: Internet
Author: User

Today, two small effects are written to test my single parameter function, the result is still a bit successful ~ ~ Here is not want to send emoticons package!

tab effect is very simple, here I will not repeat, directly on the code:

HTML code:

<Divclass= "Content">    <Divclass= "Tab1 CF">        <ul>            <Li>First item</Li>            <Li>Second item</Li>            <Li>Third item</Li>        </ul>    </Div>    <Divclass= "TaB2 CF">        <Div>1111 First Content</Div>        <Div>2222 second Content</Div>        <Div>3333 Third Content</Div>    </Div></Div>

CSS code:

. Tab1 Li {        float: left;         width: 98px;         Border:1px solid #f00;         display: inline-block;         height: 50px;    } . TaB2 Div {        border:1px solid #f00;         width: 300px;         height: 100px;    }

JS Code:

functiontabswitch (tab) {vartabbox=tab; varTab1li=tabbox.find (". Tab1 li"); varTab2div=tabbox.find (". TaB2 Div");        Tab2div.hide (); Tabbox.find (". Tab1 li:first-child"). CSS ("Background", "#FABB3E"); Tabbox.find (". TaB2 div:first-child"). Show (); Tab1li.click (function(){            varindex=$ ( This). index (); $( This). CSS ("Background", "#FABB3E"). Siblings (). CSS ("Background", "#fff");        Tab2div.eq (Index). Show (). siblings (). Hide ();        }); return false; } tabswitch ($ (". Content"));//Call the Tabswitch function

OK, this can be called many times ~

!!

So ugly people do not appreciate, this blog is mainly not prominent style, we can according to their favorite to change the CSS is good!

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.