900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > JS实现带圆弧背景渐变效果的导航菜单代码【javascript】

JS实现带圆弧背景渐变效果的导航菜单代码【javascript】

时间:2022-07-07 21:10:35

相关推荐

JS实现带圆弧背景渐变效果的导航菜单代码【javascript】

web前端|js教程

JS,圆弧,背景渐变,导航菜单

web前端-js教程

本文实例讲述了JS实现带圆弧背景渐变效果的导航菜单代码。分享给大家供大家参考。具体如下:

局域网屏幕监控源码,vscode在线网站,ubuntu线程id,tomcat缓存释放机制,爬虫母,php 站群管理系统,母婴行业seo推广策划,小说网站dede源码,帝国cms7.2企业模板lzw

这是一款效果个性的JS+CSS导航菜单,鼠标经过时出现有趣弧形背景,实际上,这里用CSS调用了背景,用JavaScript控制了背景的移动,用jQuery实现过类似的功能,整体感觉很不错。

微分购源码,vscode运行es6报错,ubuntu调整语言,.tomcat8安装,爬虫简易教程,php类的静态方法的区别,仙桃茶叶seo推广都有哪些渠道lzw

运行效果截图如下:

app打包平台源码,ubuntu 无法上网了,视频信息爬虫,php单击,seo招聘滁州lzw

在线演示地址如下:

/js//js-css-cicle-cha-nav-menu-demo/

具体代码如下:

圆弧背景的导航菜单*{margin:0px;padding:0px;font-size:12px;}.div_menu{ position:absolute;left:100px;top:100px;}.ul_menu{list-style:none;}.ul_menu li{float:left;margin-left:1px;border:1px solid #33CCCC;display:block;padding:5px 3px;background:url(images/menu_bg.jpg) repeat-x 0px -80px;padding:2px 12px;}.ul_menu li a{height:40px;width:auto;color:#ffffff;font-size:20px;font-weight:600;text-decoration:none;}var isIE = (document.all)?true:false;var $ID = function(id){ return "string"==typeof id?document.getElementById(id):id;}var Class = { create:function(){ return function(){ this.initilize.apply(this,arguments); } }}var Extend = function(destination, source){ for(var property in source){ destination[property] = source[property]; }}var Bind = function(object,fun){ var args = Array.prototype.slice.call(arguments).slice(2); return function(){ return fun.apply(object,args); }}var BindAsEventListener = function(object,fun){ var args = Array.prototype.slice.call(arguments).slice(2); return function(event){ return fun.apply(object,[event||window.event].concat(args)); }}function addEventHandler(oTarget, sEventType, fnHandler) { if (oTarget.addEventListener) { oTarget.addEventListener(sEventType, fnHandler, false); } else if (oTarget.attachEvent) { oTarget.attachEvent("on" + sEventType, fnHandler); } else { oTarget["on" + sEventType] = fnHandler; }};function removeEventHandler(oTarget, sEventType, fnHandler) { if (oTarget.removeEventListener) { oTarget.removeEventListener(sEventType, fnHandler, false); } else if (oTarget.detachEvent) { oTarget.detachEvent("on" + sEventType, fnHandler); } else { oTarget["on" + sEventType] = null; }};var MyMenu = Class.create();MyMenu.prototype = { initilize:function(ul){ this.lis = ul.getElementsByTagName("li"); for(var i=0;i=0){ window.clearTimeout(this.timer); this.i = 0; }else{ this.ShowBg(); this.timer = window.setTimeout(this._fnMouseOver,10); } }, MouseOut:function(){ this.Stop(); this.i-=2; if(this.i<=-80){ window.clearTimeout(this.timer); this.i = -80; }else{ this.ShowBg(); this.timer = window.setTimeout(this._fnMouseOut,10); } }, ShowBg:function(){ this.li.style.backgroundPosition = "0px " + this.i + "px"; }, Stop:function(){ if(this.timer){ window.clearTimeout(this.timer); } }}onload = function(){ new MyMenu($ID("ul_menu"));}

欢迎光临 最新更新 下载排行 网页特效 广告联系

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