The effect _jquery of the navigation Pull-down menu implemented by jquery

Source: Internet
Author: User

The example of this article describes the effect of the navigation Pull-down menu implemented by jquery. Share to everyone for your reference, specific as follows:

1. The effect is as shown in the picture:

2.html Code:

<div id= "Navigation" > <ul> <li><a href= "#" > Home </a></li> <li><a href= " # "> Shirt </a> <ul> <li><a href=" # "> short-sleeved shirt </a></li> <li><a href= 
  "#" > long-sleeved shirts </a></li> <li><a href= "#" > Sleeveless shirt </a></li> </ul> </li>
      <li><a href= "#" > Guardian dress </a> <ul> <li><a href= "#" > Cardigan </a></li> <li><a href= "#" > Set head Guardian dress </a></li> </ul> </li> <li><a href= "#" > Trousers </a> <ul> <li><a href= "#" > Casual pants </a></li> <li><a href= "#" > Khakis </a></li> <li><a href= "#" > Jeans </a></li> <li><a href= "#" > Shorts </ a></li> </ul> </li> <li><a href= "#" > Contact us </a></li> </ul> <

 /div>

3.jQuery Code:

Navigation effect (compatible IE6)/
*
1. Use the $ ("#navigation ul Li:has (UL)") function to select <li> elements that contain <ul> elements, and then add hover events
to them. 2. Within the first function of the hover event, use $ (this). Children ("UL") to locate the <ul> element inside the <li> element, and then use the Stop (TRUE,TRUE) statement to extend the navigation down by
3. Within the second function of the hover event, use the Stop (true,true). Slideup ("fast") statement to hide the navigation up to
4. The Stop (True,true) method was added before the two animation effects. The advantage of this is that you can empty the completed animation queue and move the animation you are performing to the end state
* * (
function () {
  $ ("#navigation ul Li:has (UL)"). Hover (function () {
   $ (this). Children ("ul"). Stop (true,true). Slidedown,
  },function () {
   $ (this). Children ("ul"). Stop (true,true). Slideup ("fast");
  })


More interested readers of jquery-related content can view the site topics: "jquery Extended Tips," "jquery common Plug-ins and Usage summary", "jquery drag-and-drop effects and tips summary", "jquery table (table) Operation Tips Summary", " A summary of Ajax usage in jquery, a summary of common classic effects in jquery, a summary of jquery animation and special effects usage, and a summary of jquery selector usage

I hope this article will help you with the jquery program design.

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.