jQuery實(shí)現(xiàn)類似標(biāo)簽風(fēng)格的導(dǎo)航菜單效果代碼
本文實(shí)例講述了jQuery實(shí)現(xiàn)類似標(biāo)簽風(fēng)格的導(dǎo)航菜單效果代碼。分享給大家供大家參考。具體如下:
這是一款基于jquery實(shí)現(xiàn)的類似TAB標(biāo)簽樣式的網(wǎng)站導(dǎo)航菜單,引入了jquery,若運(yùn)行代碼后左上角提示錯(cuò)誤,刷新頁面即可正常。你可點(diǎn)擊菜單查看到整體的效果。點(diǎn)擊后對(duì)應(yīng)菜單項(xiàng)下移,可擴(kuò)展成二級(jí)菜單,也可以改成TAB標(biāo)簽布局,感興趣的朋友自己研究吧。
運(yùn)行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-bq-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=gb2312" />
<title>jquery標(biāo)簽式導(dǎo)航菜單</title>
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$(".menubt").click(function(){
$(this).blur();
if($(this).siblings("div").css("display") == "none") {
$(".menucount:visible").slideUp(200,function(){ $(this).parent().css("zIndex","100");});
$(this).siblings("div").slideDown(200,function(){ $(this).parent().css("zIndex","10");});
$(this).siblings("div").attr("id","#boxOpen");
} else {
$(this).siblings("div").slideUp(200,function(){ $(this).parent().css("zIndex","100");});
}
})
})
</script>
<style type="text/css">
body{margin:0;padding:0;}
.menubox{position:absolute;width:100%;z-index:100;}
.menucount{display:none;height:80px;overflow:hidden;background:#999999;}
#boxOpen{height:80px;display:block;}
.menubt{display:block;float:right;position:absolute;display:block;background:url(images/menubg23.gif);color:#FFFFFF;text-decoration:none;width:78px;height:21px;text-align:center;font-size:12px;}
.menubtOpen{display:block;float:right;position:absolute;display:block;background:#0066FF;color:#FFFFFF;text-decoration:none;width:50px;}
</style>
</head>
<body>
<div class="menubox">
<div class="menucount"></div>
<a class="menubt" style="right:240px;" href="#">菜單一</a>
</div>
<div class="menubox">
<div class="menucount"></div>
<a class="menubt" style="right:160px;" href="#">菜單二</a>
</div>
<div class="menubox">
<div class="menucount"></div>
<a class="menubt" style="right:80px;" href="#">菜單三</a>
</div>
<div class="menubox">
<div class="menucount"></div>
<a class="menubt" style="right:0;" href="#">菜單四</a>
</div>
<p>若左下角有錯(cuò)誤,請(qǐng)刷新本頁面,點(diǎn)擊菜單可查看效果。</p>
<p> </p>
<p> </p>
<table width="728" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<p align="center"></p>
<p align="center"></p></td>
</tr>
</table>
<p> </p>
</body>
</html>
希望本文所述對(duì)大家的jquery程序設(shè)計(jì)有所幫助。
- jQuery實(shí)現(xiàn)鼠標(biāo)懸停背景翻轉(zhuǎn)的黑色導(dǎo)航菜單代碼
- jQuery+css實(shí)現(xiàn)的藍(lán)色水平二級(jí)導(dǎo)航菜單效果代碼
- jquery實(shí)現(xiàn)美觀的導(dǎo)航菜單鼠標(biāo)提示特效代碼
- JQuery自適應(yīng)窗口大小導(dǎo)航菜單附源碼下載
- jQuery實(shí)現(xiàn)簡單的列表式導(dǎo)航菜單效果代碼
- jquery實(shí)現(xiàn)紅色豎向多級(jí)向右展開的導(dǎo)航菜單效果
- jQuery實(shí)現(xiàn)淡入淡出二級(jí)下拉導(dǎo)航菜單的方法
- jQuery插件PageSlide實(shí)現(xiàn)左右側(cè)欄導(dǎo)航菜單
- jQuery實(shí)現(xiàn)Meizu魅族官方網(wǎng)站的導(dǎo)航菜單效果
相關(guān)文章
jQuery切換網(wǎng)頁皮膚并保存到Cookie示例代碼
這篇文章主要介紹通過jQuery切換網(wǎng)頁皮膚并將狀態(tài)保存到Cookie的相關(guān)代碼,需要的朋友可以參考下2014-06-06
基于jquery的Repeater實(shí)現(xiàn)代碼
本文和大家詳解如何使用javascript來實(shí)現(xiàn)一個(gè)asp.net 的Repeater控件,叫jQuery.Repeater插件。一起來看下吧。2010-07-07
jQuery Ajax提交表單查詢獲得數(shù)據(jù)實(shí)例代碼
用戶輸入一個(gè)表單,輸入準(zhǔn)考證和驗(yàn)證碼,驗(yàn)證用戶是否輸入表單,點(diǎn)擊查詢提交,然后從服務(wù)器得到返回的數(shù)據(jù)并顯示出來2012-09-09
jquery 面包屑導(dǎo)航 具體實(shí)現(xiàn)
jquery 面包屑導(dǎo)航 具體實(shí)現(xiàn),需要的朋友可以參考一下2013-06-06
詳解jQuery中關(guān)于Ajax的幾個(gè)常用的函數(shù)
AJAX 是一種在無需重新加載整個(gè)網(wǎng)頁的情況下,能夠更新部分網(wǎng)頁的技術(shù)。下面通過本文給大家分享jQuery中關(guān)于Ajax的幾個(gè)常用的函數(shù),需要的的朋友參考下2017-07-07
利用jQuery的deferred對(duì)象實(shí)現(xiàn)異步按順序加載JS文件
如果你現(xiàn)在對(duì)jQuery中的deferred還不了解,jQuery的deferred對(duì)象詳解一文接下來介紹deferred對(duì)象如何實(shí)現(xiàn)異步順序加載JS文件,感興趣的你可以參考下哈2013-03-03
基于jQuery制作小圖標(biāo)上下滑動(dòng)特效
一個(gè)小圖標(biāo)特效,非常有趣的,下面給大家分享基于jquery制作的小圖標(biāo)上下滑動(dòng)特效,代碼簡單易懂,需要的朋友參考下2017-01-01

