jQuery實(shí)現(xiàn)的動(dòng)態(tài)伸縮導(dǎo)航菜單實(shí)例
本文實(shí)例講述了jQuery實(shí)現(xiàn)的動(dòng)態(tài)伸縮導(dǎo)航菜單。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
<!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 select</title>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<style type="text/css">
body {padding:10px; font-family:"宋體"}
* {margin:0; padding:0; font-size:12px;}
a{ color: #333;}
ul,li {
list-style-type:none;
}
.menu_list li a {
display:block; line-height:30px;
text-align:center; height:30px;
background:#e8e8e8; border-bottom:1px solid #ccc;
}
.hover {
background:#e8e8e8;
}
.div1{
height:200px; display:none;
padding:5px;
}
.menu_list{
width:200px; background:#f2f2f2;
border:1px solid #ccc;
}
</style>
<script type="text/javascript">
$(document).ready(function()
{
$(".menu_list ul li").click(function()
{
if($(this).children(".div1").is(":hidden"))
//判斷對(duì)象是顯示還是隱藏
{
if(!$(this).children(".div1").is(":animated")){
//如果當(dāng)前沒(méi)有進(jìn)行動(dòng)畫,則添加新動(dòng)畫
$(this).children(".div1").animate({height:'show'},1000)
.end().siblings().find(".div1").hide(1000);}
}else{
if(!$(this).children(".div1").is(":animated")){
$(this).children(".div1").animate({height:'hide'},1000)
.end().siblings().find(".div1").hide(1000);}
}
}
);
});
</script>
<div class="menu_list" id="secondpane">
<ul>
<li class="">
<a href="javascript:void(0);" class="a1">網(wǎng)頁(yè)特效</a>
<div class="div1">js特效,網(wǎng)頁(yè)特效</div>
</li>
<li class="">
<a href="javascript:void(0);" class="a1">網(wǎng)頁(yè)模板</a>
<div class="div1">網(wǎng)頁(yè)模板下載</div>
</li>
<li class="">
<a href="javascript:void(0);" class="a1" style="border:none;">聯(lián)系我們 </a>
<div class="div1" style="border-top:1px solid #ccc;">關(guān)于腳本之家</div>
</li>
</ul>
</div>
</body>
</html>
希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。
- JQuery 寫的個(gè)性導(dǎo)航菜單
- 基于jquery實(shí)現(xiàn)導(dǎo)航菜單高亮顯示(兩種方法)
- jQuery彈性滑動(dòng)導(dǎo)航菜單實(shí)現(xiàn)思路及代碼
- Jquery實(shí)現(xiàn)帶動(dòng)畫效果的經(jīng)典二級(jí)導(dǎo)航菜單
- 基于jQuery的簡(jiǎn)單的列表導(dǎo)航菜單
- 純CSS打造的導(dǎo)航菜單(附j(luò)query版)
- jQuery三級(jí)下拉列表導(dǎo)航菜單代碼分享
- Jquery+CSS 創(chuàng)建流動(dòng)導(dǎo)航菜單 Fluid Navigation
- jQuery實(shí)現(xiàn)簡(jiǎn)潔的導(dǎo)航菜單效果
- jQuery漸變發(fā)光導(dǎo)航菜單的實(shí)例代碼
- 分享14個(gè)很酷的jQuery導(dǎo)航菜單插件
- jQuery實(shí)現(xiàn)的背景動(dòng)態(tài)變化導(dǎo)航菜單效果
- 制作jquery遮罩層效果導(dǎo)航菜單代碼分享
- jQuery實(shí)現(xiàn)簡(jiǎn)單漂亮的Nav導(dǎo)航菜單效果
相關(guān)文章
jquery+CSS3模擬Path2.0動(dòng)畫菜單效果代碼
這篇文章主要介紹了jquery+CSS3模擬Path2.0動(dòng)畫菜單效果代碼,涉及jquery鼠標(biāo)click點(diǎn)擊事件及頁(yè)面元素樣式動(dòng)態(tài)變換的實(shí)現(xiàn)技巧,需要的朋友可以參考下2015-08-08
jQuery選擇器源碼解讀(四):tokenize方法的Expr.preFilter
這篇文章主要介紹了jQuery選擇器源碼解讀(四):tokenize方法的Expr.preFilter,本文用詳細(xì)的注釋解讀了tokenize方法的Expr.preFilter的實(shí)現(xiàn)源碼,需要的朋友可以參考下2015-03-03
jquery的總體架構(gòu)分析及實(shí)現(xiàn)示例詳解
學(xué)習(xí)開源框架,童鞋們最想學(xué)到的就是設(shè)計(jì)的思想和實(shí)現(xiàn)的技巧。最近研究jQuery源碼,記錄一下我對(duì)jquery的理解和心得,跟大家分享,權(quán)當(dāng)拋磚引玉。2014-11-11
jQuery調(diào)用RESTful WCF示例代碼(GET方法/POST方法)
本篇文章主要介紹了jQuery調(diào)用RESTful WCF示例代碼(GET方法/POST方法),需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2014-01-01
jQuery實(shí)現(xiàn)帶漸顯效果的人物多級(jí)關(guān)系圖代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)帶漸顯效果的人物多級(jí)關(guān)系圖,可實(shí)現(xiàn)多種關(guān)系的顯示及點(diǎn)擊后漸顯切換效果,涉及jQuery響應(yīng)鼠標(biāo)事件動(dòng)態(tài)修改頁(yè)面元素顯示效果的相關(guān)技巧,需要的朋友可以參考下2015-10-10
jQuery實(shí)現(xiàn)獲取當(dāng)前鼠標(biāo)位置并輸出功能示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)獲取當(dāng)前鼠標(biāo)位置并輸出功能,涉及jQuery事件響應(yīng)及頁(yè)面元素屬性動(dòng)態(tài)操作相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-01-01

