100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > js实现的动画导航菜单效果代码【javascript】

js实现的动画导航菜单效果代码【javascript】

时间:2019-10-07 03:57:40

相关推荐

js实现的动画导航菜单效果代码【javascript】

web前端|js教程

js,动画,导航菜单

web前端-js教程

本文实例讲述了js实现的动画导航菜单效果代码。分享给大家供大家参考。具体如下:

便民工具php源码,扩展vscode终端命令,ubuntu增加驱动,mac中安装tomcat,java 爬虫 标签,php curl中文乱码,seo排名外推违规词,php开发网站要下载哪个,旧模板送哪里lzw

这是一款简单的动画导航菜单效果,每个菜单项的下边有一个横线会随着鼠标的对应而自动滑动,指明当前菜单的位置。

京东商城1G源码,vscode如何设置扩展设置,ubuntu 显示延迟,tomcat的web日志,爬虫网站授权,php截取指定字符之后,杭州网优化seo公司,动力社区电影网站模板,ecshop 3.0 免费模板lzw

运行效果截图如下:

卡盟图片psd源码,运行vscode时连接被重置,ubuntu没有fctix,多个tomcat同时启动,眼睛鼻子爬虫,php封装成app,南通seo服务推广外包快速排名lzw

在线演示地址如下:

/js//js-animate-nav-menu-style-codes/

动画导航菜单body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote{margin:0; padding:0;}body { font:12px "\5B8B\4F53",san-serif; color:#808080; padding-top:6px; }a { text-decoration:none; color:#808080 }a:hover { text-decoration:underline; color:#ba2636 }ul, li { list-style:none; }#nav{ padding:41px 0 0 0; height:27px;width:542px; overflow:hidden; float:right; margin-right:17px;position:relative ;}#nav ul{ height:27px; width:100%; background: url(i/naVbotBdr.jpg) repeat-x 0 100%; }#nav ul li{ width:67px; height:24px; float:left; padding-right:28px; display:inline; cursor:pointer; overflow:hidden}#nav a{background:#999;width:100%; height:24px; display:block; float:left; outline:none; color:#fff; line-height:24px; text-align:center; font-size:16px; font-weight:bold; overflow:hidden}#navCur{ position:absolute; left:0; bottom:0; height:3px; color:#F00; width:67px; margin:0; padding:0; display: block; float:none; background:#FF0000; cursor:pointer; overflow:hidden}

1 2 3 4 5 6

(function(){ var curPostion,thisLeft, curPostion_1; var obj = getId( av).getElementsByTagName(ul)[0], timer = null ,navCur = getId( avCur),x,liArr = getId( av).getElementsByTagName(li),liLength = liArr.length-1; for (var x=0;x navCur.offsetLeft) { hover(); } else { curPostion_1 = this.offsetLeft; out(); } }; li.onmouseout=function(){ clearTimeout(timer); if (curPostion < navCur.offsetLeft) { curPostion_1 = curPostion; out(); } else { thisLeft = curPostion; hover(); } }; } function hover(){ if (navCur.offsetLeft = curPostion_1) { var a = Math.max(parseInt((navCur.offsetLeft - curPostion_1) / 15), 3); navCur.style.left = navCur.offsetLeft - a + "px"; timer = setTimeout(arguments.callee, 5); } else { navCur.style.left = curPostion_1 + "px"; clearTimeout(timer); } } function getId(id){ return document.getElementById(id) }})();

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。