Implementation of mouse-click navigation menu based on jquery animation effect with source download _jquery

Source: Internet
Author: User

Mouse click on the water Wave animation vertical navigation code based on jquery. This is a JQUERY+CSS3 based on the implementation of the effect of the vertical navigation bar effects. The effect chart is as follows:

Effect Display source Download

HTML code:

<div class= "NAV" > <ul> <li><a> Home </a></li> <li><a> About Us </a> </li> <li><a> Product Center </a></li> <li><a> Success Case </a></li> <li>&  lt;a> Contact Us </a></li> <li><a> online message </a></li> </ul> </div> <script Type= "Text/javascript" src= "js/jquery.min.js" ></script> <script type= "Text/javascript" >//jquery
  Time var parent, ink, D, X, y;
   $ (". Nav ul li a"). Click (function (e) {parent = $ (this). parent (); Create. Ink element if it doesn ' t exist if (parent.find (". Ink"). Length = = 0) parent.prepend ("<span class= ' ink ')"
   ></span> ");
   Ink = Parent.find (". Ink");
   Incase of quick double clicks stop the previous animation Ink.removeclass ("animate"); Set size of. Ink if (!ink.height () &&!ink.width ()) {//use parent ' s width or height whichever is larger For the diameter toMake a circle which can cover the entire element.
    D = Math.max (Parent.outerwidth (), Parent.outerheight ());
   Ink.css ({height:d, width:d}); }//get Click coordinates//logic = Click coordinates relative to Page-parent ' s position relative to Page-half O
   F Self height/width to make it controllable from the center;
   x = E.pagex-parent.offset (). Left-ink.width ()/2;
   y = E.pagey-parent.offset (). Top-ink.height ()/2;
  Set the position and add class. Animate Ink.css ({top:y + ' px ', left:x + ' px '}). addclass ("animate"); }) </script>

The above code is the core code of this article, relatively simple, you can according to the requirements, appropriate to add the deletion code.

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.