Collapse Tree navigation Menu instance

Source: Internet
Author: User

Collapse Tree navigation menu instance
<! DOCTYPE html>
<meta charset= "Utf-8" >
<title></title>
<style>
body{font-size:10.5pt;}
dt{
Background: #ccc;
width:500px;
}
</style>
<script src= "Jquery/1.9.0/jquery.js" ></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ (' #faq '). Find (' dd '). Hide ();
$ (' #faq '). Find (' DT '). Click (function () {
var answer = $ (this). Next ();
if (answer.is (': Visible ')) {
Answer.slideup ();
} else {
Answer.slidedown ();
}
});
});
</script>
<body>
&LT;DL id= "FAQ" >
<dt> 00 H5 Net </dt>
<dd> Welcome to the 00 H5 Net, hope to provide good advice and advice </dd>
<dt> Front-End Tutorials </dt>
&LT;DD&GT;CSS3 Tutorials </dd>
<dt>php Tutorials </dt>
<dd> the address of this site is www.00h5.com</dd>
</dl>
</body>
. $ (document). Ready (function () {}), when the document structure is fully loaded and then executes the code in the function.
. $ (' #faq '). Find (' dd '). Hide () hides the DD element, which is the two-level menu.
. $ (' #faq '). Find (' DT '). Click (function () {}), register the click event handler for the DT element.
. var answer = $ (this). Next (), gets the next element of the click Element, in this code is the DD element behind the DT element.
. if (answer.is (': Visible ')) {
Answer.slideup ();
} else {
Answer.slidedown ();
}, determines whether the element is displayed and is animated if it is displayed.
00 H5

Otherwise, just pull down the animation mode.

Collapse Tree navigation Menu instance

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.