This is the JQ code, JQ1 version is compatible with IE, JQ2 and above the version completely regardless of IE.
<script type= "Text/javascript" src= "Js/jquery-1.4.2.js" ></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("#nav li"). Hover (function () {
$ (this). FIND ("ul"). Slidedown ("slow");
},function () {
$ (this). FIND ("ul"). Slideup ("fast");
});
});
</script>
This part is CSS style, can be used directly
@charset "Utf-8";
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
Body{font:12px/normal Verdana, Arial, Helvetica, Sans-serif;}
/*nav*/
#nav. Mainlevel{background: #ffe60c; float:left;border-right:1px solid #fff; Width:140px;/*ie6 only*/}
#nav. Mainlevel a{color: #000; text-decoration:none;line-height:32px;display:block;padding:0 20px;width:100px;}
#nav. Mainlevel a:hover, #nav. Mainlevel a.cur{color: #fff; text-decoration:none;background: #062723 url (.. /images/slide-panel_03.png) 0 0 repeat-x;}
#nav. Mainlevel Ul{display:none;position:absolute;}
#nav. Mainlevel li{border-top:1px solid #fff; background: #ffe60c; width:140px;/*ie6 only*/}
This part is the HTML structure
<ul id= "nav";
<li class= "Mainlevel";
<a href= "http://sc.chinaz.com/jiaoben/" > Level navigation </ A>
<ul>
<li><a href= "http://sc.chinaz.com/jiaoben/" > Two-level navigation 1</a></li>
<li><a href= "http://sc.chinaz.com/jiaoben/" > Two-level navigation 2</a></li>
<li><a href= "http ://sc.chinaz.com/jiaoben/"> Two-level navigation 3</a></li>
</ul>
</li>
<li class= "Mainlevel" >
<a href= "http://sc.chinaz.com/jiaoben/" > Level navigation </a>
<ul>
<li><a href= "http://sc.chinaz.com/jiaoben/" > Level two navigation 1</a></li>
<li><a href= "http://sc.chinaz.com/jiaoben/" > Level two navigation 2</a></li>
<li><a href= "http://sc.chinaz.com/jiaoben/" > Level two navigation 3</a></li>
</ul>
</li>
</ul>
This is the most basic, simple drop-down menu, is I again online looking for one, the important part of the summary refined out, the later words will go to write, there are better at the same time and concise effect will be shared!
jquery drop-down menu