更多>
最新下载
jQuery鼠标滑过图文切换
jQuery鼠标滑过图文切换是一款默认为文字描述显示,当鼠标移到描述区域,自动换成图片切换演示,且带有定位滑动小按钮。本作品由【站长素材】收集整理,转载请注明出处!
0
2026-01-31
24小时阅读排行榜
- 1 javascript错误处理怎样捕获异常?【教程】
- 2 什么是javascript的防抖与节流【教程】
- 3 Go 中的函数与方法:理解接收者、指针参数及其设计意图
- 4 为什么推荐使用javascript的模板字面量【教程】
- 5 Python JSON 序列化的边界与坑点
- 6 javascript解构赋值是什么_如何提取对象和数组值【教程】
- 7 zombie 进程回收失败的 init pid=1 信号处理 bug 排查
- 8 javascript中的代理和反射是什么【教程】
- 9 Python init.py 文件的真实作用
- 10 如何在 iOS 中禁用滚动溢出效果,使其行为与 Android 一致
- 11 JavaScript如何实现路由功能【教程】
- 12 CommonJS与ES6模块在javascript中如何选择【教程】
- 13 如何让 MUI Popper 始终固定在视口内(如聊天机器人悬浮按钮)
- 14 什么是javascript及其核心语法详解【教程】
- 15 javascript中什么是可选链操作符_它如何防止错误【教程】
更多>
最新教程
-
- Node.js 教程
- 16510 2025-08-28
-
- CSS3 教程
- 1547390 2025-08-27
-
- Rust 教程
- 23592 2025-08-27
-
- Vue 教程
- 25981 2025-08-22
-
- PostgreSQL 教程
- 22494 2025-08-21
-
- Git 教程
- 9398 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
