JQery 漸變圖片導(dǎo)航效果代碼 漂亮
更新時間:2010年01月01日 01:59:03 作者:
JQery 漸變圖片導(dǎo)航,效果不錯,非常漂亮。

圖片如上。。下載圖片試試。。效果不錯哦。。JS就直接連接遠(yuǎn)程就可以了
代碼復(fù)用性差。。希望高手指點(diǎn)下,應(yīng)該怎么樣才好
復(fù)制代碼 代碼如下:
<!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>測試導(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)航欄(菜單項JSON類型/自制)
- jquery入門—編寫一個導(dǎo)航條(可伸縮)
- jquery實(shí)現(xiàn)的讓超出顯示范圍外的導(dǎo)航自動固定屏幕最頂上
- jQuery實(shí)戰(zhàn)之仿淘寶商城左側(cè)導(dǎo)航效果
- 基于jQuery的簡單的列表導(dǎo)航菜單
- 基于jquery的一個OutlookBar類,動態(tài)創(chuàng)建導(dǎo)航條
- jquery 3D球狀導(dǎo)航的文章分類
- jquery 導(dǎo)航條的效果(css選擇器控制)
- js+json用表格實(shí)現(xiàn)簡單網(wǎng)站左側(cè)導(dǎo)航
- js導(dǎo)航菜單(自寫)簡單大方
相關(guān)文章
通過上下左右鍵和回車鍵切換光標(biāo)實(shí)現(xiàn)代碼
客戶有這樣一個需求在列表中的文本框里輸入數(shù)據(jù)時,要能夠通過上下左右鍵來切換光標(biāo),按回車鍵就把光標(biāo)移到下一個文本框,接下來將為你介紹下如何實(shí)現(xiàn),感興趣的朋友可以參考下2013-03-03
jQuery實(shí)現(xiàn)的購物車物品數(shù)量加減功能代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)的購物車物品數(shù)量加減功能,涉及jQuery針對鼠標(biāo)事件的響應(yīng)及頁面元素動態(tài)操作相關(guān)技巧,需要的朋友可以參考下2016-11-11
JS中批量給元素綁定事件過程中的相關(guān)問題使用閉包解決
解決元素批量綁定事件的時候,出現(xiàn)i=最后一個循環(huán)變量的值的方法有兩種:把這個循環(huán)變量保存起來,不要讓它的作用域在整個函數(shù),而是在循環(huán)體內(nèi)2013-04-04
jquery實(shí)現(xiàn)走馬燈特效實(shí)例(撲克牌切換效果)
本文主要介紹了jquery實(shí)現(xiàn)走馬燈特效實(shí)例(撲克牌切換效果),文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-02-02
基于jQuery實(shí)現(xiàn)的美觀星級評論打分組件代碼
這篇文章主要介紹了基于jQuery實(shí)現(xiàn)的美觀星級評論打分組件代碼,涉及jQuery回調(diào)函數(shù)及頁面元素屬性動態(tài)操作的相關(guān)技巧,具有一定參考借鑒價值,需要的朋友可以參考下2015-10-10

