<! 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 ()