JQery 漸變圖片導(dǎo)航效果代碼 漂亮

圖片如上。。下載圖片試試。。效果不錯(cuò)哦。。JS就直接連接遠(yuǎn)程就可以了
代碼復(fù)用性差。。希望高手指點(diǎn)下,應(yīng)該怎么樣才好
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>測(cè)試導(dǎo)航</title>
<script src="http://img.jb51.net/jslib/jquery/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
var datacss=["home","game","zine","community","calendar","participate"];
for(var i=0;i<datacss.length;i++)
{
$("#"+datacss[i]).append("<div class='"+datacss[i]+"'></div>");
$("."+datacss[i]).css('opacity', 0);
$("#"+datacss[i]).hover(
function()
{
$("."+this.id).stop().animate({opacity: '1'},800);
},
function()
{
$("."+this.id).stop().animate({opacity: '0'},800);
});
}
});
</script>
<style type="text/css">
body { } ul li{ list-style:none; float:left; margin:0; padding:0;}
#home{background: url(navigation.jpg) top left no-repeat;
width:90px; height:55px;
}
.home {background: url(navigation.jpg) 0 -55px no-repeat;
width: 90px;height: 55px;
}
#game{background: url(navigation.jpg) -90px 0px; no-repeat;
width:114px; height:55px;
}
.game{background: url(navigation.jpg) -90px -55px no-repeat;
width:114px; height:55px;
}
#zine{background: url(navigation.jpg) -204px 0px; no-repeat;
width:96px; height:55px;
}
.zine{background: url(navigation.jpg) -204px -55px no-repeat;
width:96px; height:55px;
}
#community{background: url(navigation.jpg) -300px 0px; no-repeat;
width:144px; height:55px;
}
.community{background: url(navigation.jpg) -300px -55px no-repeat;
width:144px; height:55px;
}
#calendar{background: url(navigation.jpg) -446px 0px; no-repeat;
width:137px; height:55px;
}
.calendar{background: url(navigation.jpg) -446px -55px no-repeat;
width:137px; height:55px;
}
#participate{background: url(navigation.jpg) -583px 0px; no-repeat;
width:135px; height:55px;
}
.participate{background: url(navigation.jpg) -583px -55px no-repeat;
width:135px; height:55px;
}
</style>
</head>
<body>
<ul>
<li><a href="#"><div id="home"></div></a></li>
<li><a href="#"><div id="game"></div></a></li>
<li><a href="#"><div id="zine"></div></a></li>
<li><a href="#"><div id="community"></div></a></li>
<li><a href="#"><div id="calendar"></div></a></li>
<li><a href="#"><div id="participate"></div></a></li>
</ul>
</body>
</html>
- JavaScript NodeTree導(dǎo)航欄(菜單項(xiàng)JSON類型/自制)
- jquery入門—編寫一個(gè)導(dǎo)航條(可伸縮)
- jquery實(shí)現(xiàn)的讓超出顯示范圍外的導(dǎo)航自動(dòng)固定屏幕最頂上
- jQuery實(shí)戰(zhàn)之仿淘寶商城左側(cè)導(dǎo)航效果
- 基于jQuery的簡(jiǎn)單的列表導(dǎo)航菜單
- 基于jquery的一個(gè)OutlookBar類,動(dòng)態(tài)創(chuàng)建導(dǎo)航條
- jquery 3D球狀導(dǎo)航的文章分類
- jquery 導(dǎo)航條的效果(css選擇器控制)
- js+json用表格實(shí)現(xiàn)簡(jiǎn)單網(wǎng)站左側(cè)導(dǎo)航
- js導(dǎo)航菜單(自寫)簡(jiǎn)單大方
相關(guān)文章
通過(guò)上下左右鍵和回車鍵切換光標(biāo)實(shí)現(xiàn)代碼
客戶有這樣一個(gè)需求在列表中的文本框里輸入數(shù)據(jù)時(shí),要能夠通過(guò)上下左右鍵來(lái)切換光標(biāo),按回車鍵就把光標(biāo)移到下一個(gè)文本框,接下來(lái)將為你介紹下如何實(shí)現(xiàn),感興趣的朋友可以參考下2013-03-03
jQuery實(shí)現(xiàn)的購(gòu)物車物品數(shù)量加減功能代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)的購(gòu)物車物品數(shù)量加減功能,涉及jQuery針對(duì)鼠標(biāo)事件的響應(yīng)及頁(yè)面元素動(dòng)態(tài)操作相關(guān)技巧,需要的朋友可以參考下2016-11-11
酷炫jQuery全屏3D焦點(diǎn)圖動(dòng)畫效果
這篇文章主要介紹了一款非??犰诺膉Query全屏3D焦點(diǎn)圖動(dòng)畫效果其特點(diǎn)是整個(gè)焦點(diǎn)圖基本是全屏顯示的,非常大氣,感興趣的小伙伴們可以參考一下2016-03-03
jQuery獲取radio選中項(xiàng)的值實(shí)例
本文主要介紹jQuery獲取radio選中項(xiàng)的值的方法,希望能幫到大家,有需要的朋友可以參考一下。2016-06-06
jquery左邊浮動(dòng)到一定位置時(shí)顯示返回頂部按鈕
這篇文章主要介紹通過(guò)jquery實(shí)現(xiàn)左邊浮動(dòng)到一定位置時(shí)顯示返回頂部按鈕的效果,需要的朋友可以參考下2014-06-06
JS中批量給元素綁定事件過(guò)程中的相關(guān)問題使用閉包解決
解決元素批量綁定事件的時(shí)候,出現(xiàn)i=最后一個(gè)循環(huán)變量的值的方法有兩種:把這個(gè)循環(huán)變量保存起來(lái),不要讓它的作用域在整個(gè)函數(shù),而是在循環(huán)體內(nèi)2013-04-04
jquery實(shí)現(xiàn)走馬燈特效實(shí)例(撲克牌切換效果)
本文主要介紹了jquery實(shí)現(xiàn)走馬燈特效實(shí)例(撲克牌切換效果),文中通過(guò)示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-02-02
基于jQuery實(shí)現(xiàn)的美觀星級(jí)評(píng)論打分組件代碼
這篇文章主要介紹了基于jQuery實(shí)現(xiàn)的美觀星級(jí)評(píng)論打分組件代碼,涉及jQuery回調(diào)函數(shù)及頁(yè)面元素屬性動(dòng)態(tài)操作的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-10-10

