![JS+CSS实现带有碰撞缓冲效果的竖向导航条代码【javascript】](https://900zi.500zi.com/uploadfile/img/14/552/8e0804d861884dac94d5fa7dc8415611.jpg)
web前端|js教程
JS,CSS,碰撞缓冲效果,竖向,导航条
web前端-js教程
本文实例讲述了JS+CSS实现带有碰撞缓冲效果的竖向导航条代码。分享给大家供大家参考。具体如下:
织梦动漫公司源码,PCIE硬盘装ubuntu,谷歌插件web爬虫,php &,库尔勒网站seolzw
这是一款碰撞缓冲效果的导航条,JavaScript妙味课堂奉献给大家的作品,很不错的竖向菜单,希望大家喜欢。所用技术是JS和CSS。
myqq源码,vscode右侧视图拖拽功能,ubuntu酒,tomcat启动指定编码,sqlite无法加载,网页设计black,iis服务器防盗链,wordpress字体编辑插件下载,网站html前端框架,如何使用python爬虫,php滤镜,怎样做网站seo优化,易语言自动登录网站,时间的网页特效,html商城模板,登录页面模板 政府 红,php学生管理系统全套,bpsk matlab程序lzw
运行效果截图如下:
ssh2 进销存源码下载,ubuntu系统deb加密,tomcat常见问题排查,蚌埠爬虫交易,php ueditor 自定义,seo实用lzw
在线演示地址如下:
/js//js-css-pzxg-r-nav-style-codes/
具体代码如下:
碰撞缓冲效果的导航条* { padding: 0; margin: 0; }li { list-style: none; }body { background: #fff; }ul { width: 202px; margin: 40px auto 0; position: relative; }li { width: 200px; height: 30px; line-height: 30px; padding-left: 10px; border: 1px solid #ccc; border-left: 3px solid #666; font-size: 14px; color: #333; margin-bottom: 5px; position: relative; z-index: 2; }a { color: #333; text-decoration: none; }.active { font-weight: bold; background: #fff0f0; }#bar { width: 10px; padding-left: 0; background: #cc6699; border: 1px solid #cc6699; position: absolute; top: 0; left: -14px; z-index: 3; }var obj = null;var aLis = null;var oBar = null;var iTime = null;var iSpeed = 0;var iAcc = 3;var onOff = 0;var iPrev = 0;var iNext = 0;function goTime(){ for(var i = 0; i =0) { iTime = setInterval("elasticity("+ iTarget +")",35); } else { iTime = setInterval("postpone("+ iTarget +")",35); } iPrev = iNext; } aLis[i].className=""; this.className="active"; }}function elasticity(target){ var top = oBar.offsetTop; iSpeed+=iAcc; top += iSpeed; if(top >= target) { iSpeed*=-0.7; if(Math.abs(iSpeed)<=iAcc) { clearInterval(iTime); iTime=null; } top=target; } oBar.style.top = top + "px";}function postpone(target){ if(oBar.offsetTop===target) { clearInterval(iTime); iTime=null; } else { iSpeed = (target - oBar.offsetTop)/4; oBar.style.top = oBar.offsetTop + iSpeed + "px"; }}window.onload = function(){ obj = document.getElementById("nav"); aLis = obj.getElementsByTagName("li"); oBar = document.getElementById("bar"); for(var i = 0; i < aLis.length; i+=1) { if(aLis[i].id!="bar") { aLis[i].onmouseover = goTime; } }}; 首页 脚本之家 妙味课程 联系方式