Retractable menu, rewritten with toggle ()

Source: Internet
Author: User

<! DOCTYPE >
<meta charset= "UTF-8"/>
<title> retractable menu with toggle () rewrite </title>
<style>
<!--
body{
Background-color: #ffdee0;
}
#navigation {
width:200px;
font-family:arial;
}
#navigation > UL {
list-style-type:none;/* do not display bullets */
margin:0px;
padding:0px;
}
#navigation > Ul > li {
border-bottom:1px solid #ED9F9F;/* Add underline */
}
#navigation > Ul > li > a{
display:block;/* Block Display */
padding:5px 5px 5px 0.5em;
Text-decoration:none;
border-left:12px solid #711515;/* thick red edge on the left */
border-right:1px solid #711515;/* Right Shadow */
}
#navigation > Ul > li > A:link, #navigation > Ul > li > a:visited{
Background-color: #c11136;
Color: #FFFFFF;
}
#navigation > Ul > li > a:hover{/* mouse over time */
Background-color: #990020;/* Change the background color */
Color: #ffff00;/* Change the text color */
}

/* CSS style for submenu */
#navigation ul Li ul{
List-style-type:none;
margin:0px;
padding:0px 0px 0px 0px;
}
#navigation UL Li ul li{
border-top:1px solid #ED9F9F;
}
#navigation ul Li ul Li a{
Display:block;
padding:3px 3px 3px 0.5em;
Text-decoration:none;
border-left:28px solid #a71f1f;
border-right:1px solid #711515;
}
#navigation ul Li ul Li A:link, #navigation ul Li ul Li a:visited{
Background-color: #e85070;
Color: #FFFFFF;
}
#navigation ul Li ul Li a:hover{
Background-color: #c2425d;
Color: #ffff00;
}
-
</style>
<script src= "Http://libs.baidu.com/jquery/2.0.0/jquery.min.js" ></script>
<script language= "JavaScript" >
$ (function () {
$ ("Li"). Find ("ul"). Prev (). Click (function () {
$ (this). Next (). Toggle ();
});
$ ("Li:has (UL)"). Find ("ul"). Hide ();
});
</script>
<body>
<div id= "Navigation" >
<ul id= "Listul" >
<li><a href= "#" >Home</a></li>
<li><a href= "#" >News</a>
<ul style= "Display:block;" >
<li><a href= "#" >lastest news</a></li>
<li><a href= "#" >all news</a></li>
</ul>
</li>
<li><a href= "#" >Sports</a>
<ul style= "Display:block;" >
<li><a href= "#" >Basketball</a></li>
<li><a href= "#" >Football</a></li>
<li><a href= "#" >Volleyball</a></li>
</ul>
</li>
<li><a href= "#" >Weather</a>
<ul style= "Display:none;" >
<li><a href= "#" >today ' s weather</a></li>
<li><a href= "#" >Forecast</a></li>
</ul>
</li>
<li><a href= "#" >contact me</a></li>
</ul>
</div>

</body>

Retractable menu, rewritten with toggle ()

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.