基于jquery實(shí)現(xiàn)后臺左側(cè)菜單點(diǎn)擊上下滑動顯示
更新時間:2013年04月11日 14:52:53 作者:
一個左側(cè)菜單點(diǎn)擊是可以上下滑動,簡潔時尚,復(fù)制即可使用,感興趣的朋友可以參考下哈,希望對你有所幫助
今天做了一個左側(cè)菜單的效果,做后臺的時候應(yīng)該會經(jīng)常用到這個效果的,代碼同樣是簡潔明了,復(fù)制即可用:
效果圖如下:
代碼如下:(這個上下箭頭的圖標(biāo)如上,圖標(biāo)可自己換)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后臺左側(cè)菜單點(diǎn)擊上下滑動顯示jquery</title>
<script type="text/javascript" src="http://jt.875.cn/js/jquery.js"></script>
<script type="text/javascript">
$(function(){
$(".box dt:first").addClass("active");
$(".box dd:not(:first)").hide();
$(".box dt").click(function(){
$(this).next("dd").slideToggle()
.siblings("dd").slideUp();
$(this).toggleClass('active')
.siblings("dt").removeClass("active");
});
});
</script>
<style type="text/css">
* { padding:0; margin:0; }
body { padding:100px; font:12px "宋體"; }
dl,dt,dd{list-style:none;}
.box { width:500px; border-bottom:1px solid #CCC; }
.box dt { height:30px; line-height:30px; padding:0 10px; font-size:12px; cursor:pointer; border:1px solid #ccc; border-bottom:none; background:#eee url(img/bg.gif) no-repeat right -27px; }
.box dt.active { background-position:right 7px; }
.box dd { border-left:1px solid #ccc; border-right:1px solid #ccc; padding:0 10px; }
.box dd p{line-height:20px; }
</style>
</head>
<body>
<div class="box">
<dl>
<dt>標(biāo)題一</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
<dt>標(biāo)題二</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
<dt>標(biāo)題三</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
<dt>標(biāo)題四</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
</dl>
</div>
</body>
</html>
效果圖如下:

代碼如下:(這個上下箭頭的圖標(biāo)如上,圖標(biāo)可自己換)
復(fù)制代碼 代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后臺左側(cè)菜單點(diǎn)擊上下滑動顯示jquery</title>
<script type="text/javascript" src="http://jt.875.cn/js/jquery.js"></script>
<script type="text/javascript">
$(function(){
$(".box dt:first").addClass("active");
$(".box dd:not(:first)").hide();
$(".box dt").click(function(){
$(this).next("dd").slideToggle()
.siblings("dd").slideUp();
$(this).toggleClass('active')
.siblings("dt").removeClass("active");
});
});
</script>
<style type="text/css">
* { padding:0; margin:0; }
body { padding:100px; font:12px "宋體"; }
dl,dt,dd{list-style:none;}
.box { width:500px; border-bottom:1px solid #CCC; }
.box dt { height:30px; line-height:30px; padding:0 10px; font-size:12px; cursor:pointer; border:1px solid #ccc; border-bottom:none; background:#eee url(img/bg.gif) no-repeat right -27px; }
.box dt.active { background-position:right 7px; }
.box dd { border-left:1px solid #ccc; border-right:1px solid #ccc; padding:0 10px; }
.box dd p{line-height:20px; }
</style>
</head>
<body>
<div class="box">
<dl>
<dt>標(biāo)題一</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
<dt>標(biāo)題二</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
<dt>標(biāo)題三</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
<dt>標(biāo)題四</dt>
<dd>
<p><a href="#">第一項</a></p>
<p><a href="#">第二項</a></p>
<p><a href="#">第三項</a></p>
</dd>
</dl>
</div>
</body>
</html>
您可能感興趣的文章:
- php+jQuery實(shí)現(xiàn)的三級導(dǎo)航欄下拉菜單顯示效果
- jQuery實(shí)現(xiàn)的點(diǎn)擊顯示隱藏下拉菜單功能完整示例
- jQuery實(shí)現(xiàn)菜單的顯示和隱藏功能示例
- jQuery實(shí)現(xiàn)點(diǎn)擊后高亮背景固定顯示的菜單效果【附demo源碼下載】
- jQuery實(shí)現(xiàn)可高亮顯示的二級CSS菜單效果
- jquery實(shí)現(xiàn)在網(wǎng)頁指定區(qū)域顯示自定義右鍵菜單效果
- jquery實(shí)現(xiàn)鼠標(biāo)經(jīng)過顯示下劃線的漸變下拉菜單效果代碼
- jquery實(shí)現(xiàn)鼠標(biāo)滑過顯示二級下拉菜單效果
- 基于jquery實(shí)現(xiàn)導(dǎo)航菜單高亮顯示(兩種方法)
- 鼠標(biāo)懸浮顯示二級菜單效果的jquery實(shí)現(xiàn)
- jquery實(shí)現(xiàn)下拉菜單的二級聯(lián)動利用json對象從DB取值顯示聯(lián)動
- jQuery實(shí)現(xiàn)菜單顯示效果
相關(guān)文章
jquery實(shí)現(xiàn)二級導(dǎo)航下拉菜單效果實(shí)例
這篇文章主要介紹了jquery二級導(dǎo)航下拉菜單,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-05-05基于Jquery和html5實(shí)現(xiàn)炫酷的3D焦點(diǎn)圖動畫
這篇文章主要介紹了基于Jquery和html5實(shí)現(xiàn)炫酷的3D焦點(diǎn)圖動畫的相關(guān)資料,焦點(diǎn)圖中的圖片利用了CSS3的相關(guān)特性實(shí)現(xiàn)圖片傾斜效果,從而讓圖片出現(xiàn)3D的視覺效果,感興趣的小伙伴們可以參考一下2016-03-03jquery實(shí)現(xiàn)轉(zhuǎn)盤抽獎功能
本文主要介紹了用的jqueryRotate插件實(shí)現(xiàn)轉(zhuǎn)盤抽獎功能的方法,具有一定的參考價值,下面跟著小編一起來看下吧2017-01-01