jQuery實(shí)現(xiàn)灰藍(lán)風(fēng)格標(biāo)準(zhǔn)二級下拉菜單效果代碼
本文實(shí)例講述了jQuery實(shí)現(xiàn)灰藍(lán)風(fēng)格標(biāo)準(zhǔn)二級下拉菜單效果代碼。分享給大家供大家參考。具體如下:
這是一款基于jQuery實(shí)現(xiàn)的標(biāo)準(zhǔn)型二級菜單,是漂亮的灰-藍(lán)風(fēng)格下拉級聯(lián)菜單,代碼經(jīng)過了完美修正,目前兼容性已經(jīng)很不錯了,甚至不用修改,拷貝代碼你就可以用了。
運(yùn)行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-blue-color-style-nav-menu-codes/
具體代碼如下:
<!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=utf-8" />
<title>jQuery標(biāo)準(zhǔn)型二級菜單</title>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<style type="text/css">
body
{
margin:0; padding:0; font-size:12px;
}
a:link {
color:#1553a9; text-decoration: none;
}
a:visited {
text-decoration:none; color: #1553a9;
}
a:hover {
text-decoration:none; color: #f46662;
}
a:active {
text-decoration: none; color:#f46662;
}
#main
{
width:910px; margin:0 auto;
}
#menu
{
margin-top:20px; position:absolute;
}
.m1
{
float:left; width:100px; text-align:center; color:#3a3a3a; background-color:#bcbcbc; border:#9a9b9b 1px solid; border-right:0; padding:10px; padding-top:13px; cursor:pointer;
}
.m1:hover
{
background-color:#2c85e0; color:White;
}
.m2
{
position:absolute; margin-top:39px; width:120px; background-color:#e4e4e4;border:#cdcece 1px solid;color:#666666; display:none;
}
.m2 table
{
width:100%; line-height:35px;
}
.m2 table tr td
{
text-align:center; border-top:#b4b4b4 1px dotted; cursor:pointer;
}
</style>
<script type="text/javascript">
$(function(){
$(".m1").mouseover(function(){
$(this).parent().next(".m2").fadeIn();
}).mouseout(function(){
$(this).parent().next(".m2").css("display","none");
});
$(".m2").mouseover(function(){
$(this).css("display","block");
$(this).prev().children().css("background-color","#2c85e0").css("color","White");;
}).mouseout(function(){
$(this).css("display","none");
$(this).prev().children().css("background-color","#bcbcbc").css("color","#3a3a3a");
});
});
</script>
</head>
<body>
<div id="main">
<div id="menu">
<a href="#" target="_blank"><span class="m1">論壇首頁</span></a>
<a href="#" target="_blank"><span class="m1">學(xué)生工作</span></a>
<div class="m2" style="left:121px;"><table>
<tr><td style="border:0"><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
</table></div>
<a href="#" target="_blank"><span class="m1">師資隊(duì)伍</span></a>
<div class="m2" style="left:242px;"><table>
<tr><td style="border:0"><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
</table></div>
<a href="#" target="_blank"><span class="m1">學(xué)科專業(yè)</span></a>
<div class="m2" style="left:363px;"><table>
<tr><td style="border:0"><a href="#" target="_blank">本科專業(yè)</a></td></tr>
<tr><td><a href="#" target="_blank">碩士專業(yè)</a></td></tr>
<tr><td><a href="#" target="_blank">博士專業(yè)</a></td></tr>
</table></div>
<a href="#" target="_blank"><span class="m1">教學(xué)改革</span></a>
<div class="m2" style="left:484px;"><table>
<tr><td style="border:0"><a href="#" target="_blank">教學(xué)體制</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)院首頁</a></td></tr>
<tr><td><a href="#" target="_blank">科研教學(xué)</a></td></tr>
</table></div>
<a href="#" target="_blank"><span class="m1">黨建工作</span></a>
<div class="m2" style="left:605px;"><table>
<tr><td style="border:0"><a href="#" target="_blank">學(xué)生黨建</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)院黨建</a></td></tr>
</table></div>
<a href="#" target="_blank"><span class="m1">聯(lián)系我們</span></a>
<div class="m2" style="left:725px;"><table>
<tr><td style="border:0"><a href="#" target="_blank">老師電話</a></td></tr>
<tr><td><a href="#" target="_blank">領(lǐng)導(dǎo)傳真</a></td></tr>
<tr><td><a href="#" target="_blank">學(xué)校地址</a></td></tr>
<tr><td><a href="#" target="_blank">衛(wèi)星地圖</a></td></tr>
</table></div>
</div>
</div>
</body>
</html>
希望本文所述對大家的jquery程序設(shè)計(jì)有所幫助。
相關(guān)文章
jQuery實(shí)現(xiàn)的無縫廣告圖片左右滾動功能詳解
這篇文章主要介紹了jQuery實(shí)現(xiàn)的無縫廣告圖片左右滾動功能,結(jié)合實(shí)例形式詳細(xì)分析了jQuery無縫滾動圖片的實(shí)現(xiàn)原理、步驟與具體操作技巧,需要的朋友可以參考下2016-12-12
HTML5使用DeviceOrientation實(shí)現(xiàn)搖一搖功能
這篇文章主要介紹了HTML5使用DeviceOrientation實(shí)現(xiàn)搖一搖功能的相關(guān)資料,需要的朋友可以參考下2015-06-06
基于jQuery的前端數(shù)據(jù)通用驗(yàn)證庫
做了這么長時間的開發(fā),一直因?yàn)轵?yàn)證的問題相當(dāng)?shù)目鄲溃粩嗟膶懞芏嘀貜?fù)的代碼,對想偷懶的我來說是相當(dāng)痛苦的。2011-08-08
jquery 獲取 outerHtml 包含當(dāng)前節(jié)點(diǎn)本身的代碼
jQuery.html() 是獲取當(dāng)前節(jié)點(diǎn)下的html代碼,并不包含當(dāng)前節(jié)點(diǎn)本身的代碼,后來實(shí)驗(yàn)發(fā)現(xiàn)有一個jQuery的一個方法可以解決2014-10-10
jQuery制作input提示內(nèi)容(兼容IE8以上)
這篇文章主要為大家詳細(xì)介紹了jQuery制作input提示內(nèi)容,兼容IE8以上,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07
jQuery基于ID調(diào)用指定iframe頁面內(nèi)的方法
這篇文章主要介紹了jQuery基于ID調(diào)用指定iframe頁面內(nèi)的方法,涉及jQuery針對頁面框架元素的選擇與方法的調(diào)用技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2016-07-07
圖片放大鏡jquery.jqzoom.js使用實(shí)例附放大鏡圖標(biāo)
這篇文章主要介紹了圖片放大鏡jquery.jqzoom.js的使用另附放大鏡圖標(biāo),需要的朋友可以參考下2014-06-06
有關(guān)easyui-layout中的收縮層無法顯示標(biāo)題的解決辦法
本文由腳本之家小編給大家介紹有關(guān)easyui-layout中的收縮層無法顯示標(biāo)題的原因分析及解決辦法,感興趣的朋友可以參考下2016-05-05

