更多>
最新下载
24小时阅读排行榜
- 1 php怎么限制IP访问_通过IP白名单过滤请求的方法【技巧】
- 2 Go 中 Goroutine 死锁问题的根源与正确解决方法
- 3 css :nth child 选择器怎么用_列表样式控制示例
- 4 如何在 PHP 中正确处理并转换数据库查询的多条记录为结构化数组
- 5 如何彻底阻止用户查看 JavaScript 源代码?——真相与实用防护策略
- 6 css 浮动布局高度不一致怎么处理_通过清除浮动保持布局完整
- 7 如何使用Golang掌握包使用_Golangimport与包管理实践
- 8 如何在点击圆形按钮时让多个元素同步旋转
- 9 如何从SQL数据库动态填充下拉菜单(Dropdown)
- 10 c++的适配器模式(Adapter Pattern)是什么 如何兼容不兼容的接口【设计模式】
- 11 Python工程化系统学习路线第229讲_核心原理与实战案例详解【教程】
- 12 如何使用Golang mock对象进行单元测试_模拟依赖接口行为
- 13 如何在移动端触控时缩放网页(支持缩小)
- 14 JavaScript中什么是WebSocket_如何建立连接
- 15 c++怎么操作postgresql数据库_c++ libpqxx连接与事务逻辑实现【实战】
更多>
最新教程
-
- Node.js 教程
- 14782 2025-08-28
-
- CSS3 教程
- 1542385 2025-08-27
-
- Rust 教程
- 22360 2025-08-27
-
- Vue 教程
- 24803 2025-08-22
-
- PostgreSQL 教程
- 21482 2025-08-21
-
- Git 教程
- 8553 2025-08-21
jQuery点击水波动画竖直导航栏代码
js代码
<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 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>
一款简洁漂亮的基于jQuery+CSS3实现的带水波动画效果的竖直导航栏代码,鼠标点击导航菜单链接出现水波动画特效。
本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn
