jQuery+CSS實(shí)現(xiàn)菜單滑動(dòng)伸展收縮(仿淘寶)
功能很實(shí)用,代碼非常的簡(jiǎn)單
效果1.

效果2.

樣式代碼如下:
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,br,pre,form,fieldset,input,textarea,p,blockquote,th,td{
margin:0;
padding:0
}
span{
color:#FF2B13
}
a{
text-decoration:none;
color:#515050
}
a:hover{
text-decoration:underline;
color:red
}
.box_all{
overflow:hidden;
width:350px;
font-family:"微軟雅黑";
font-size:14px;
border:1px solid #EEEEEE;
border-top:2px solid #F57A04;
padding:0 0 10px 0;
margin:0 auto
}
.box{
padding-left:45px;
padding-top:5px
}
.box li{
line-height:20px;
margin-right:30px;
width:120px;
text-align:left;
float:left;
list-style-type:none
}
.boxdown{
cursor:pointer;
border:1px solid #EEEEEE;
width:60px;
height:14px;
background:#FFFFFF url(../images/down.png) no-repeat 20px;
margin-left:150px;
margin-top:-2px;
border-top:none;
margin:0 auto
}
.up{
cursor:pointer;
border:1px solid #EEEEEE;
width:60px;
height:14px;
background:#FFFFFF url(../images/up.png) no-repeat 20px;
margin-left:150px;
margin-top:-2px;
border-top:none;
margin:0 auto
}
js主要代碼如下:
$(document).ready(function(){
var a =$(".box ul li:gt(3):not(:last)");
a.hide();
$(".boxdown").click(function(){
if(a.is(':visible')){
a.slideUp('fast');
$(this).removeClass('up');
}else{
a.slideDown('fast').show();
$(this).addClass('up');
}
});
});
- jquery實(shí)現(xiàn)簡(jiǎn)單Tab切換菜單效果
- 基于jQuery實(shí)現(xiàn)的菜單切換效果
- jQuery實(shí)現(xiàn)Tab菜單滾動(dòng)切換的方法
- jQuery實(shí)現(xiàn)帶幻燈的tab滑動(dòng)切換風(fēng)格菜單代碼
- 基于jQuery插件實(shí)現(xiàn)環(huán)形圖標(biāo)菜單旋轉(zhuǎn)切換特效
- jQuery實(shí)現(xiàn)菜單式圖片滑動(dòng)切換
- 7款風(fēng)格新穎的jQuery/CSS3菜單導(dǎo)航分享
- jquery+css+ul模擬列表菜單具體實(shí)現(xiàn)思路
- 純CSS打造的導(dǎo)航菜單(附j(luò)query版)
- jQuery+css實(shí)現(xiàn)的藍(lán)色水平二級(jí)導(dǎo)航菜單效果代碼
- jQuery+CSS實(shí)現(xiàn)簡(jiǎn)單切換菜單示例
相關(guān)文章
jquery 動(dòng)態(tài)增加刪除行的簡(jiǎn)單實(shí)例(推薦)
下面小編就為大家?guī)?lái)一篇jquery 動(dòng)態(tài)增加刪除行的簡(jiǎn)單實(shí)例(推薦)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10
JQuery擴(kuò)展插件Validate—4設(shè)置錯(cuò)誤提示的樣式
JQuery擴(kuò)展插件Validate—4設(shè)置錯(cuò)誤提示的樣式,使用Validate的朋友可以參考下。2011-09-09
jquery UI Datepicker時(shí)間控件的使用方法(終結(jié)版)
這篇文章是jquery UI Datepicker時(shí)間控件的使用方法終結(jié)版,可以說(shuō)是技術(shù)的升華,實(shí)現(xiàn)的功能有限制的開(kāi)始時(shí)間和結(jié)束時(shí)間跨度不超過(guò)三天,并配置有清空時(shí)間,重選時(shí)間等,感興趣的小伙伴們可以參考一下2015-11-11
Jquery上傳插件 uploadify v3.1使用說(shuō)明
uploadify ,簡(jiǎn)單實(shí)用的flash上傳組件,兼容性良好。 現(xiàn)已有html5版本2012-06-06
jQuery實(shí)現(xiàn)簡(jiǎn)單評(píng)論功能
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)簡(jiǎn)單評(píng)論功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-08-08
jQuery實(shí)現(xiàn)的省市聯(lián)動(dòng)菜單功能示例【測(cè)試可用】
這篇文章主要介紹了jQuery實(shí)現(xiàn)的省市聯(lián)動(dòng)菜單功能,結(jié)合完整實(shí)例形式分析了jQuery實(shí)現(xiàn)級(jí)聯(lián)菜單的具體流程與操作方法,涉及jQuery表單及數(shù)組元素的遍歷及事件響應(yīng)處理技巧.非常簡(jiǎn)單實(shí)用,需要的朋友可以參考下2017-01-01
jQuery實(shí)現(xiàn)的多級(jí)下拉菜單效果代碼
這篇文章主要介紹了jQuery實(shí)現(xiàn)的多級(jí)下拉菜單效果代碼,涉及jquery鼠標(biāo)事件及頁(yè)面元素的顯示與隱藏效果實(shí)現(xiàn)技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2015-08-08

