Examples of jquery dynamic navigation plug-in dynamicNav usage,

Source: Internet
Author: User

Examples of jquery dynamic navigation plug-in dynamicNav usage,

This document describes how to use the jquery dynamic navigation plug-in dynamicNav. Share it with you for your reference. The details are as follows:

This is a self-written jquery dynamic navigation plug-in-dynamicNav. The specific idea is:

1. Insert a span label to all li resources and contain the label in li.
2. Copy a tag and insert it into the span. Now there are two a tags in the span.
3. Determine whether the switch is vertical or horizontal based on the input parameters. If the switch is vertical, change the span width to the width of a tag. Then the two a tags are vertically arranged, here, you must set the overflow: hidden of li; otherwise, two a labels will be displayed. If it is horizontal, change the span width to the width of two a labels, and change the li width to the width of one a label, because I didn't set the li width in css, it changes with the width of the tag. If you set the width of all navigation menus to the same width, you can add the width attribute to the css.
The fourth step is to start making the animation effect and use the hover event to process the effect when the mouse passes and leaves.

Use animate of jquery to change the margin-top (vertical direction) and margin-left (horizontal direction) of span.

The running effect is as follows:

The Online Demo address is as follows:

Http://demo.jb51.net/js/2015/jquery-tab-cha-plug-dynamicNav-codes/

The Code is as follows:

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

I hope this article will help you with jquery programming.

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.