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>