模板無憂
網頁特效
每日更新
|
TOP排行榜
|
Tag標簽
|
充值
無憂首頁
網頁模板
程序模板
建站教程
視頻教程
網頁特效
圖標素材
字體下載
站長工具
站長問答
網頁特效
菜單導航
圖片特效
文本鏈接
層和布局
頁面背景
表單按鈕
日期時間
計算轉換
鍵盤鼠標
瀏覽器
游戲娛樂
綜合其它
常用代碼
jQuery特效
Prototype
Ajax/JavaScript
ExtJS
CSS特效
在線編輯器
Mootools
HTML
JS廣告代碼合集
站長工具
站長常用軟件
網站綜合查詢
Alexa排名查詢
Google PR查詢
域名Whois查詢
網站收錄查詢
友情鏈接查詢
CSS2中文手冊
CSS精簡優化工具
網頁特效代碼
模板無憂
>
網頁特效
>
菜單導航特效代碼
>
收藏
分享
查看評論
菜單導航
演示
帶緩沖的伸縮下拉菜單_菜單導航特效
查看演示效果
特效Tag:
下拉菜單
層展開
添加
伸縮下拉菜單,帶緩沖,點擊以后分別載進不同的圖片,實際上也可以此為基礎制作圖片導航,很不錯的效果。
<html> <head> <title>帶緩沖的伸縮下拉菜單</title> <meta http-equiv="mrc-Type" mrc="text/html;charset=gb2312"> <style> body{ background:white } #menuList{ border-bottom:solid 1px #333333; width:500px; } .boxStyle .caption{ border-top:none; cursor:pointer; background:#33FF99; height:30px; line-height:30px; font-family:"Lucida Sans Unicode"; font-size:12px; padding-left:5px; } .boxStyle{ border:solid 1px #333333; border-bottom:none; background:#0099CC; overflow:hidden; position:relative } img{ border:none } .infor{ background:#000000; position:absolute; bottom:0; left:0; width:100%; filter: Alpha(opacity=50); -moz-opacity:.5; opacity:0.5; display:none; cursor:pointer } .infor:hover{ filter: Alpha(opacity=90); -moz-opacity:.9; opacity:.9; } </style> <script type="text/javascript"> window.onload=function(){ getData(); init(); imgInfor(); } var speed=0; var openOrClose=1; var check=2; var INIT_HEIGHT="30px"; var inforOHeight="20px"; var inforEHeight="320px"; var k_menuBox=new Array(); var k_originalHeight=new Array(); var k_caption=new Array(); var k_infor=new Array(); function $(ele,tags){ if(tags=="id"){ return document.getElementById(ele); } else return getElementsBytagName(ele); } function getData(){ var k=$("menuList","id").getElementsByTagName("div"); for(var i=0;i<k.length;i++){ if(k[i].className=="infor"){ k_infor.push(k[i]); k[i].style.height=inforOHeight; } if(k[i].className=="boxStyle"){ k_menuBox.push(k[i]); k_originalHeight.push(k[i].style.height); initHeight(); var t=k[i].getElementsByTagName("div"); for(var ii=0;ii<t.length;ii++){ if(t[ii].className=="caption"){ k_caption.push(t[ii]); } } } } } function imgInfor(){ for(var i=0;i<k_infor.length;i++){ k_infor[i].style.display="none"; k_infor[i].style.height=inforOHeight; k_infor[i].onclick=function(){ if(check==0){ if(this.style.height==inforOHeight){ openIt(this,inforEHeight); } else{ closeBox(this,inforOHeight); } } } } } function initHeight(){ for(var i=0;i<k_menuBox.length;i++){ k_menuBox[i].style.height=INIT_HEIGHT; } } function findIt(){ for(var i=0;i<k_menuBox.length;i++){ if(k_menuBox[i].style.height!=INIT_HEIGHT){ return k_menuBox[i]; } } return false; } function closeBox(ele,lastHeight){ check=1; openOrClose=0; if(ele!=false){ var h=parseInt(ele.style.height); if(h>parseInt(lastHeight)){ animation(ele,lastHeight,50,8,"close"); setTimeout(function(){closeBox(ele,lastHeight)},1); } else{ ele.style.height=lastHeight; check=0; openOrClose=1; } } } //打開盒子 function openIt(ele,lastHeight){ check=1; openOrClose=0; var h=parseInt(ele.style.height); if(h<parseInt(lastHeight)){ animation(ele,lastHeight,50,8,"open"); setTimeout(function(){openIt(ele,lastHeight)},1); } else{ ele.style.height=lastHeight; check=0; openOrClose=1; } } function animation(ele,lastHeight,ends,speeds,tag){ if(Math.abs(parseInt(ele.style.height)-parseInt(lastHeight))>ends){ if(speed<speeds) speed+=1; } else{ if(speed!=1) speed--; } var g=parseInt(ele.style.height); if(tag=="open") g+=speed; else g-=speed; ele.style.height=g+"px"; } function changeCaptionStyle(ele){ for(var i=0;i<k_caption.length;i++){ k_caption[i].style.backgroundColor="#33FF99"; k_caption[i].style.color="#333333"; if(k_caption[i]==ele){ k_caption[i].style.color="white"; ele.style.backgroundColor="#006666"; } } } function changeCaptionStyle2(ele,bgcolor){ if(ele.parentNode.style.height==INIT_HEIGHT){ ele.style.backgroundColor=bgcolor; } } function init(){ for(var i=0;i<k_caption.length;i++){ k_caption[i].index = i; k_caption[i].onmouseover=function(){ changeCaptionStyle2(this,"#33CC99"); } k_caption[i].onmouseout=function(){ changeCaptionStyle2(this,"#33FF99"); } k_caption[i].onclick=function(){ if(openOrClose==0){ return false; } changeCaptionStyle(this); if(this.parentNode.style.height==INIT_HEIGHT){ imgInfor(); k_infor[this.index].style.display="block"; closeBox(findIt(),INIT_HEIGHT); openIt(this.parentNode,k_originalHeight[this.index]); } else{ imgInfor(); changeCaptionStyle(); closeBox(findIt(),INIT_HEIGHT); } } } } </script> </head> <body> <div id="menuList"> <div style="height:350px;" class="boxStyle"> <div class="caption">英國巨石陣,至今仍是謎</div> <a href="/" target="_blank"> <div class="infor"></div> <img src="http://p1.mb5u.com/texiao/1/wall5.jpg"> </a> </div> <div style="height:350px;" class="boxStyle"> <div class="caption">德國鄉村,人與自然和諧</div> <a href="http://www.wf0088.com" target="_blank"> <div class="infor"></div> <img src="http://p1.mb5u.com/texiao/1/wall6.jpg"> </a> </div> <div style="height:350px;" class="boxStyle"> <div class="caption">納差湖,一片潔凈之地</div> <a href="/" target="_blank"> <div class="infor"></div> <img src="http://p1.mb5u.com/texiao/1/wall7.jpg"> </a> </div> </div> </body> </html>
所屬頻道:
菜單導航特效
/
更新時間:2011-02-24
[收藏]
[報錯]
[返回列表]
相關
菜單導航特效
:
CSS+div+js組合強大實現超酷菜單
超酷仿GOOGLE首頁導航菜單效果
仿網易的滑動門技術DIV+CSS實現
仿藍色理想網站的導航菜單
鼠標觸及帶邊框菜單
用JS實現的類似框架的鏈接導航模式
CSS立體層
右鍵彈出菜單
純css的導航下拉菜單
隱藏菜單效果
css模擬title和alt的提示效果
下拉菜單鏈接頁面打開方式選擇
菜單導航特效Rss訂閱
特效代碼搜索
菜單導航特效推薦
css模擬title和alt的提示效果
目錄式導航菜單-鼠標放上的下拉菜單
這么簡單就實現了CSS滑動菜單(滑動門)
CSS制作的中英文雙語菜單
CSS實現Windows風格的菜單按鈕
新浪滑動門(黃色經典)
列表、排行專用的灰、紅滑動門菜單
超帥的CSS菜單導航(當前項帶下劃線)
導航菜單特效 (突出的接鈕似效果)
自寫的一Javascript右鍵菜單類
猜你也喜歡看這些
CSS強制等比例縮小圖片
CSS 圖片放大查看特效
JS圖片濾鏡自己轉換效果,焦點圖切換
Javascript圖片幻燈代碼(無jquery)
國外的Js圖片瀏覽效果
縱向圖片滾動JS代碼
Js圖片勻速向上滾動
Js拖動特效,一串水晶球
Marquee 圖片滾動特效
圖像過來
相關鏈接:
復制本頁鏈接
|
搜索帶緩沖的伸縮下拉菜單
特效說明:
菜單導航模板
-
帶緩沖的伸縮下拉菜單
。