jquery drop-down menu

Source: Internet
Author: User

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

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.