JQery 漸變圖片導(dǎo)航效果代碼 漂亮
圖片如上。。下載圖片試試。。效果不錯哦。。JS就直接連接遠(yuǎn)程就可以了
代碼復(fù)用性差。。希望高手指點下,應(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>測試導(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實現(xiàn)的讓超出顯示范圍外的導(dǎo)航自動固定屏幕最頂上
- jQuery實戰(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用表格實現(xiàn)簡單網(wǎng)站左側(cè)導(dǎo)航
- js導(dǎo)航菜單(自寫)簡單大方
相關(guān)文章
jQuery插件實現(xiàn)多級聯(lián)動菜單效果
開發(fā)一個jQuery插件實現(xiàn)多級聯(lián)動菜單效果,實現(xiàn)步驟很詳細(xì),感興趣的小伙伴們可以參考一下2015-12-12jquery.alert 彈出式復(fù)選框?qū)崿F(xiàn)代碼
jquery alert 彈出式 復(fù)選框,需要的朋友可以參考下,代碼有點亂。2009-06-06jQuery實現(xiàn)的導(dǎo)航動畫效果(附demo源碼)
這篇文章主要介紹了jQuery實現(xiàn)的導(dǎo)航動畫效果,可實現(xiàn)導(dǎo)航條的底部橫條隨鼠標(biāo)移動的效果,涉及jQuery針對鼠標(biāo)事件的響應(yīng)及頁面元素樣式動態(tài)變換的相關(guān)技巧,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下2016-04-04使用jQuery Ajax 請求webservice來實現(xiàn)更簡練的Ajax
以往我們在做ajax時,都要借助于一般處理程序(.ashx)或web服務(wù)(.asmx),并且每一個請求都要建一個這樣的文件,非常麻煩,下面我們甩掉ashx和asmx來使用jQuery Ajax 請求webservice來實現(xiàn)更簡練的Ajax,需要的朋友參考下2016-08-08jquery實現(xiàn)手機(jī)發(fā)送驗證碼的倒計時代碼
這篇文章主要介紹了jquery實現(xiàn)手機(jī)發(fā)送驗證碼的倒計時代碼,需要的朋友可以參考下2014-02-02jQuery使用siblings獲取某元素所有同輩(兄弟姐妹)元素用法示例
這篇文章主要介紹了jQuery使用siblings獲取某元素所有同輩(兄弟姐妹)元素用法,結(jié)合簡單實例形式分析了siblings()函數(shù)獲取同輩元素的操作技巧,需要的朋友可以參考下2017-01-01基于jquery+thickbox仿校內(nèi)登錄注冊框
近日,客戶說他想要個類似于人人網(wǎng)(以前為校內(nèi))的登錄框效果,于是上網(wǎng)搜了下,發(fā)現(xiàn)有一個仿得比較好的,于是就拿過來用了用。2010-06-06詳解JavaScript異步編程中jQuery的promise對象的作用
這篇文章主要介紹了JavaScript異步編程中jQuery的promise對象的作用,同時也談到了js的Dojo框架中promise模式的實現(xiàn),需要的朋友可以參考下2016-05-05