一款简洁漂亮的基于jQuery+CSS3实现的带水波动画效果的竖直导航栏代码,鼠标点击导航菜单链接出现水波动画特效。
js代码
<script type="text/javascript" src="https://img.x22t.com/file/2020/04/25/6eaaee32446acaddb89fa300c79dc3bc7367.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>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。源码素材属于虚拟商品,具有可复制性,可传播性,一旦授予,不接受任何形式的退款、换货要求。请您在购买获取之前确认好 是您所需要的资源
1.本站提供的一切源码、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途!
2.本站信息来自网络收集整理,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑或手机中彻底删除上述内容!
3.本站提供的源码,模板,插件等其他资源都不包含技术服务,敬请谅解!
4.本站资源售价只是赞助,收取费用仅维持本站日常运营所需!
5.如无备注,本站不保证所提供下载的资源准确性安全性和完整性,源码仅供下载学习之用!
6.如用于商业或者非法用途,与本站无关。一切后果请自行负责!
7.如果遇到加密压缩包,默认解压密码为:btzy.cc或bori99.com如遇到无法解压请联系站长!