Jquery image tab switching

Source: Internet
Author: User

Copy codeThe Code is as follows: <! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Script src = "http://demo.jb51.net/jslib/jquery/jquery.js" type = "text/javascript"> </script>
<Style>
<! --
Body {
Margin: 10px auto;
Width: 570px;
Font: 75%/120% Arial, Helvetica, sans-serif;
}
. Accordion {
Width: 480px;
Border-bottom: solid 1px # c4c4c4;
}
. Accordion h3 {
Background: # e9e7e7 url (images/arrow-square.gif) no-repeat right-51px;
Padding: 7px 15px;
Margin: 0;
Font: bold 120%/100% Arial, Helvetica, sans-serif;
Border: solid 1px # c4c4c4;
Border-bottom: none;
Cursor: pointer;
}
. Accordion h3: hover {
Background-color: # e3e2e2;
}
. Accordion h3.active {
Background-position: right 5px;
}
. Accordion p {
Background: # f7f7f7;
Margin: 0;
Padding: 10px 15px 20px;
Border-left: solid 1px # c4c4c4;
Border-right: solid 1px # c4c4c4;
}
--> </Style>
<Script type = "text/javascript"> </script>
<Div class = "accordion">
<H3> Question One Sample Text <P style = "display: none;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa
Diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula. </p>
<H3> This is Question Two <P style = "display: none;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa
Diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula. </p>
<H3> Another Questio here <P style = "display: none;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa
Diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula. </p>
<H3 class = "active"> Sample heading <P style = "display: block;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa
Diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula. </p>
<H3> Sample Question Heading <P style = "display: none;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa
Diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula. </p>
</Div>
<Script type = "text/javascript"> // <! [CDATA [
$ (Function (){
/* $ ('. Accordion h3'). click (function (){
$ ('. Accordion p'). hide ();
$ (This). next (). show ();
});*/
Var Q = {
H3: $ ('. accordion h3 '),
P: $ ('. accordion p '),
Qiehuan: function (){
This. h3.click (function (){
Q. p. hide ();
$ (This). next (). show ();
});
}
};
Q. qiehuan ();
});
//]> </Script>

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.