模板無憂
網頁特效
每日更新
|
TOP排行榜
|
Tag標簽
|
充值
無憂首頁
網頁模板
程序模板
建站教程
視頻教程
網頁特效
圖標素材
字體下載
站長工具
站長問答
網頁特效
菜單導航
圖片特效
文本鏈接
層和布局
頁面背景
表單按鈕
日期時間
計算轉換
鍵盤鼠標
瀏覽器
游戲娛樂
綜合其它
常用代碼
jQuery特效
Prototype
Ajax/JavaScript
ExtJS
CSS特效
在線編輯器
Mootools
HTML
JS廣告代碼合集
站長工具
站長常用軟件
網站綜合查詢
Alexa排名查詢
Google PR查詢
域名Whois查詢
網站收錄查詢
友情鏈接查詢
CSS2中文手冊
CSS精簡優化工具
網頁特效代碼
模板無憂
>
網頁特效
>
菜單導航特效代碼
>
收藏
分享
查看評論
菜單導航
演示
X-Menu 動感導航菜單_菜單導航特效
查看演示效果
特效Tag:
動感菜單
添加
X-Menu 動感導航菜單,效果很好。像FLASH動畫一樣,有愛好的朋友好好研究一下。
<html> <head> <title>X-Menu</title> <style> .b{color=#000066;cursor:hand} .menu { font-family:Arial; cursor:Default; font-size:12px; border:1px #000000 solid; border-collapse: collapse; filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=0, startcolorstr=#ffffff, endcolorstr=#dddddd) progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#cccccc,strength=3); } .ht{ font-weight:bold } </style> <script> function CoolMenuControl(){ this.lastScrollX=0; this.lastScrollY=0; this.lastScrollW=0; this.lastScrollH=0; this.td_X=0; this.td_Y=0; this.td_W=0; this.td_H=0; this.td=0; this.mouseon=0; this.current=null this.hk_name; this.hktable_name; this.menudiv_name; this.menutable_name; this.ml=0; this.menuarray=new Array(); this.speed; this.href=""; //-----菜單項目--- function menuitem(type,value,url,target){ this.type=type this.value=value this.url=url this.target=target } //插入菜單--- this.insertmenu=function(type,value,url,target){ this.menuarray[this.menuarray.length]=new menuitem(type,value,url,target) } //初試化--- this.init=function(name,bdc,bgc,speed,Alpha){ var inhtml="" var cellcount=0 var lastcellcount=0 this.hk_name=name+"hk" this.hktable_name=name+"hktable" this.menudiv_name=name+"menudiv" this.menutable_name=name+"menutable" this.speed=speed for (i=0;i<this.menuarray.length;i++) { if (this.menuarray[i].type=="2") cellcount=cellcount+1 if (this.menuarray[i].type=="1" || this.menuarray[i].type=="0") {cellcount=0} if (lastcellcount<cellcount) {lastcellcount++} } stylecode="cursor:hand;filter:Alpha(style=0,opacity="+Alpha+");background-color:"+bgc suspendcode="<DIV id="+this.hk_name+" style='POSITION:absolute;' onclick='"+name+".doClick()'>" +"<table id="+this.hktable_name+" border='1' width='0' cellspacing='0' style='border-collapse: collapse' bordercolor='"+bdc+"'>" +"<tr><td height='18' style='"+stylecode+"'></td></tr></table></div>"; document.write(suspendcode); var fcell=true for (i=0;i<this.menuarray.length;i++) { switch(this.menuarray[i].type) { case "0": t=cellcount*2 if (t<=0) { inhtml+='<tr><td colspan=2 class=ht onmouseover=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value } else { inhtml+='<tr><td colspan='+t+' class=ht onmouseover=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value } fcell=true break; case "1": t=(cellcount-1)*2 if (t<=0) { inhtml+='<tr><td width=6><td onmouseover=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value } else { inhtml+='<tr><td width=6><td colspan='+t+' onmouseover=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value } fcell=true break; case "2": if (fcell) { inhtml+='<tr><td width=6><td onmouseover=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value; fcell=false } else { inhtml+='<td width=6><td onmouseover=\''+name+'.href="'+this.menuarray[i].url+','+this.menuarray[i].target+'"\'>'+this.menuarray[i].value; } break; } } inhtml='<div id='+this.menudiv_name+' onmousemove="'+name+'.doOver()">' +'<table id='+this.menutable_name+' border="0" cellpadding="2" class="menu" cellspacing="4">' +inhtml +'</table></div>'; //alert(inhtml) document.write(inhtml); this.lastScrollX=0; this.lastScrollY=-4; this.posXY(eval(this.menutable_name).cells[0]) this.td_W=eval(this.menutable_name).cells[0].scrollWidth+6 this.td_H=eval(this.menutable_name).cells[0].scrollHeight setInterval(name+".scrollback()",1) } //-----單擊超連接--- this.doClick=function(){ //alert(this.url) var url=this.href.split(",") //alert(url[0]) //alert(url[1]) if (url[0]=="") return if (url[1]=="_blank") {window.open(url[0])} else {location.href=url[0]} } //-----滑動處理--- this.scrollback=function(){ diffX=this.td_X-3 diffY=this.td_Y-5 diffW=this.td_W diffH=this.td_H percentX=this.speed*(diffX-this.lastScrollX); percentY=this.speed*(diffY-this.lastScrollY); percentW=this.speed*(diffW-this.lastScrollW); percentH=this.speed*(diffH-this.lastScrollH); if(percentX>0)percentX=Math.ceil(percentX); else percentX=Math.floor(percentX); if(percentY>0)percentY=Math.ceil(percentY); else percentY=Math.floor(percentY); if(percentW>0)percentW=Math.ceil(percentW); else percentW=Math.floor(percentW); if(percentH>0)percentH=Math.ceil(percentH); else percentH=Math.floor(percentH); eval(this.hk_name).style.pixelTop+=percentY; eval(this.hk_name).style.pixelLeft+=percentX; eval(this.hktable_name).style.pixelWidth+=percentW; eval(this.hktable_name).style.pixelHeight+=percentH; this.lastScrollX=this.lastScrollX+percentX; this.lastScrollY=this.lastScrollY+percentY; this.lastScrollW=this.lastScrollW+percentW; this.lastScrollH=this.lastScrollH+percentH; } //-----滑出--- this.doOver=function() { if (event.srcElement.tagName=="TD") { if (event.srcElement.innerText.length==0 || event.srcElement.innerText=="|") return this.posXY(event.srcElement) this.td_W=event.srcElement.scrollWidth+6 this.td_H=event.srcElement.scrollHeight } } //-----絕對定位--- this.posXY=function(obj){ hk_left=obj.offsetLeft hk_top=obj.offsetTop vParent = obj.offsetParent; while (vParent.tagName.toUpperCase() != "BODY") { hk_left += vParent.offsetLeft; hk_top += vParent.offsetTop; vParent = vParent.offsetParent; } this.td_X=hk_left this.td_Y=hk_top } //-----關于--- this.about=function(){ alert("OK") } } </script> <!-- 第一步:實體化X-Menu類 用法: var <實體變量>.new CoolMenuControl() ---> <script language="javascript"> var CoolMenu1=new CoolMenuControl() var CoolMenu2=new CoolMenuControl() var CoolMenu3=new CoolMenuControl() var about=new Array() about[0]="關于X-Menu菜單\n\nAuthor:PuterJam\nCopyright 2004\n轉載請通知本人" about[1]="關于作者QQ:10644570\nE-Mail:PuterJam@etang.com" </script> </head> <body> <!-- 第二步:建立菜單項目--- 用法: <實體變量>.insertmenu(類型,Html代碼,鏈接網址,目標) 類型:0代表菜單標題,0代表樹型菜單子項目,2代表橫向菜單子項目Html代碼:顯示在菜單上的Html代碼 鏈接網址:不用多說了,網址或Javascript腳本 目標:默認為空,既不在本頁打開;"_blank"代表在新的頁面打開 例如: CoolMenu2.insertmenu("2","<img src=http://p1.mb5u.com/texiao/arrow.gif> 百度一下","http://www.baidu.com/","_blank") --> <script> CoolMenu1.insertmenu("0","歡迎使用X-Menu (菜單演示)<br> <font style='font-weight:lighter;'>Made By PuterJam</font>","","") CoolMenu1.insertmenu("0"," ","http://www.baidu.com/","_blank") CoolMenu2.insertmenu("0","<img src=http://p1.mb5u.com/texiao/arrow.gif> 橫向菜單","","") CoolMenu2.insertmenu("2","<img src=http://p1.mb5u.com/texiao/arrow.gif> 源碼愛好者","/","_blank") CoolMenu2.insertmenu("2","<img src=http://p1.mb5u.com/texiao/arrow.gif> 最新更新","http://cn.yahoo.com/","_blank") CoolMenu2.insertmenu("2","<img src=http://p1.mb5u.com/texiao/arrow.gif> 站長博客","/","_blank") CoolMenu2.insertmenu("2","<img src=http://p1.mb5u.com/texiao/arrow.gif> 更新排行","/","_blank") CoolMenu2.insertmenu("2","<img src=http://p1.mb5u.com/texiao/arrow.gif> 源碼下載","/","_blank") CoolMenu3.insertmenu("0","<img src=/images/logo.gif width=148 height=50>","","") CoolMenu3.insertmenu("0","<img src=http://p1.mb5u.com/texiao/sds.gif> X-Menu簡介 ","/","_blank") CoolMenu3.insertmenu("1","關于菜單","javascript:alert(about[0])","") CoolMenu3.insertmenu("1","關于作者","javascript:alert(about[1])","") CoolMenu3.insertmenu("1","聯系我吧","mailto:PuterJam@etang.com","") CoolMenu3.insertmenu("1","瀏覽器版本","javascript:alert(navigator.appName)","") </script> <!-- 第三步:建立菜單--- 用法: <實體變量>.init(實體變量名,邊框顏色,背景顏色,滑動速度,背景半透明度) '實體變量名'必須與<實體變量>相同 如果背景顏色="transparent"既為完全透明 例如: CoolMenu1.init("CoolMenu1","#002000","#38FFff",0.1,15) --> <script>CoolMenu1.init("CoolMenu1","#002000","#38FFff",0.1,15)</script> <script>CoolMenu2.init("CoolMenu2","#002000","#00FF80",0.2,10)</script> <script>CoolMenu3.init("CoolMenu3","#002000","#f0FF00",0.3,25)</script> </body> </html>
所屬頻道:
菜單導航特效
/
更新時間:2011-02-24
[收藏]
[報錯]
[返回列表]
相關
菜單導航特效
:
CSS+div+js組合強大實現超酷菜單
超酷仿GOOGLE首頁導航菜單效果
仿網易的滑動門技術DIV+CSS實現
仿藍色理想網站的導航菜單
鼠標觸及帶邊框菜單
用JS實現的類似框架的鏈接導航模式
CSS立體層
右鍵彈出菜單
純css的導航下拉菜單
隱藏菜單效果
css模擬title和alt的提示效果
下拉菜單鏈接頁面打開方式選擇
菜單導航特效Rss訂閱
特效代碼搜索
菜單導航特效推薦
又一淘寶網的TAB選項卡,很圓滑
多種文本框輸入格式限制的JS代碼
帶顏色標記的CSs導航欄
CSS+JS圓角下拉菜單
標準CSS+Js下拉菜單
強烈推薦的一款CSS導航菜單
div+css+js實現菜單的收縮與展開
行為、結構、表現分離的CSS選項卡
js實現無限級樹形導航列表
一個垂直型的彈性圖片菜單
猜你也喜歡看這些
不間斷JS圖片滾動
讓IE6不出現圖像工具欄
Js封裝勻速循環的橫向圖片滾動
JS水平循環飛舞的圖片
從兩側向中間拼合的JavaScript圖片切換效果
JS平滑圖片滾動
圖片圍成環形滾動,有空間感
結合JavaScript,實現圖片以漸顯的方式自動播放
Js移動圖片、獲得圖片坐標、設置圖片隱藏等等
根據鼠標放上切換內容制作的圖片導航
相關鏈接:
復制本頁鏈接
|
搜索X-Menu 動感導航菜單
特效說明:
菜單導航模板
-
X-Menu 動感導航菜單
。