Beautiful folding effect (jquery)

Source: Internet
Author: User

Recently, I made a project to make a folding effect,

After half a day, I finally couldn't do it. I found an effect, a lot of code, but I wrote it myself and shared it with you. If it was useful, I could download it directly, I feel that the writing is still very concise, and the set of programs is very convenient.

Reprinted, please specify the source. Thank you!

 

HTML code

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> </title>
<SCRIPT type = "text/JavaScript" src = "JS/jquery-1.6.4.min.js"> </SCRIPT>
<Style type = "text/CSS">
# Myul {width: 504px ;}
# Myul Li {list-style: none; Border: 1px solid #96c2f1; padding: 1px ;}
# Myul Li span {list-style: none; Background: # b2d3f5; width: 480px; Height: 20px; display: block; padding-left: 20px ;}
# Myul Li span. Hand {cursor: pointer; Background: # b2d3f5 URL (img/right.gif) No-repeat 5px center ;}
# Myul Li span. Current {Background: # b2d300 URL (img/down.gif) No-repeat 5px center ;}
# Myul Li Div {Background: # eff7ff; width: 490px; padding: 0px 5px 5px 5px ;}


</Style>
<SCRIPT type = "text/JavaScript">
$ (Function (){
$ ("# Myul Li Div"). Hide ();
$ ("# Myul Li span"). addclass ("hand ");
$ ("# Myul Li span"). Click (function (){
$ (This). toggleclass ("current ");
$ (This). Parent (). siblings (). Find ("span"). removeclass ("current ");
$ (This). Parent (). Find ("Div. Hid"). slidetoggle ("fast ");
$ (This). Parent (). siblings (). Find ("Div"). slideup ("fast ");
});
})
</SCRIPT>
</Head>
<Body>
<Ul id = "myul">
<Li> <span> Level 1 menu </span>
<Div class = "hid">
<P> weapons Oh, Satan's law, Satan's law, and Satan's law <br/> asdfasfdasfd </P>
<P> weapons Oh, Satan's law, Satan's law, and Satan's law <br/> asdfasfdasfd </P>
</Div>

</LI>
<Li> <span> Level 2 menu </span>
<Div class = "hid"> weapon Oh, Satan's law of Satan's law </div> </LI>
<Li> <span> Level 3 menu </span>
<Div class = "hid">
<P> weapons Oh, Satan's law, Satan's law, and Satan's law asdfasfdasfd </P>
<P> weapons Oh, Satan's law, Satan's law, and Satan's law <br/> asdfasfdasfd </P>
<P> weapons Oh, Satan's law, Satan's law, and Satan's law asdfasfdasfd </P>
<P> weapons Oh, Satan's law, Satan's law, and Satan's law <br/> asdfasfdasfd </P>
</Div>
</LI>
</Ul>
</Body>
</Html>

 

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.