更多>
最新下载
24小时阅读排行榜
- 1 css背景渐变颜色怎么写更直观_使用rgb或hsl定义渐变色
- 2 php读取rtf文件编码不对咋整_php读取rtf编码转换法【教程】
- 3 C++ 怎么让线程休眠 C++ this_thread::sleep_for使用教程【多线程】
- 4 html5如何实现图片擦除效果_html5擦除互动教程【技巧】
- 5 php微信小程序多语言怎支持_php实现i18n切换法【技巧】
- 6 c++中如何判断一个年份是否为闰年_c++逻辑运算符应用实例【汇总】
- 7 php模拟post请求dns缓存_phppostdns缓存刷新法【步骤】
- 8 php二维转一维怎样捕获异常_php二维降维异常处理写法【步骤】
- 9 php实现班级通信录导入权限不足_php赋权导入解决方法【方案】
- 10 FIMO输出HTML包含文本对齐方式吗_FIMO输出HTML对齐参数【说明】
- 11 php格式文件能在linux终端打开吗_linux终端打开php法【教程】
- 12 React Router v6 布局嵌套:实现带侧边栏的条件渲染与路由结构优化
- 13 C++ 友元类有什么用 C++ friend关键字破坏封装性分析【概念】
- 14 如何正确处理 Go 中的错误检查逻辑以避免意外提前返回
- 15 css样式加载配置错误示例_新手常见踩坑
更多>
最新教程
-
- Node.js 教程
- 16205 2025-08-28
-
- CSS3 教程
- 1546738 2025-08-27
-
- Rust 教程
- 23337 2025-08-27
-
- Vue 教程
- 25797 2025-08-22
-
- PostgreSQL 教程
- 22277 2025-08-21
-
- Git 教程
- 9256 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
