星空网 > 软件开发 > Java

基于jQuery鼠标点击水波动画竖直导航代码

基于jQuery鼠标点击水波动画竖直导航代码。这是一款基于jQuery+CSS3实现的带动画效果的竖直导航栏特效。效果图如下:

基于jQuery鼠标点击水波动画竖直导航代码

在线预览    源码下载

实现的代码。

html代码:

<div class="nav">   <ul>     <li><a>网站首页</a></li>     <li><a>关于我们</a></li>     <li><a>产品中心</a></li>     <li><a>成功案例</a></li>     <li><a>联系我们</a></li>     <li><a>在线留言</a></li>   </ul> </div>  <script type="text/javascript" src='/images/loading.gif' data-original="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 to make 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 of 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>

via:http://www.w2bc.com/article/2015-12-04-jquery-click-animate-nav




原标题:基于jQuery鼠标点击水波动画竖直导航代码

关键词:jquery

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

aae国际快递:https://www.goluckyvip.com/tag/100649.html
国际支付:https://www.goluckyvip.com/tag/10065.html
澳洲专线国际物流有限公司:https://www.goluckyvip.com/tag/100650.html
寄国际物流怎么收费:https://www.goluckyvip.com/tag/100651.html
ddu国际快递:https://www.goluckyvip.com/tag/100652.html
scs国际快递:https://www.goluckyvip.com/tag/100653.html
北京到嵩山自驾游沿途景点 北京距离嵩山有多远:https://www.vstour.cn/a/411244.html
泰国签证有出生地 泰国出生入籍护照:https://www.vstour.cn/a/411245.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流