以下是 jQuery扁平风格手风琴式菜单特效代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>jQuery扁平风格手风琴式菜单</title>
<!-- 样式表 -->
<link rel="stylesheet" href="css/gbtags.css">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<h1 class="CRPCandGBouquet"><i class="fa fa-bookmark"></i> jQuery扁平风格手风琴式菜单效果</h1>
<dl>
<dt> <i class="fa fa-users"></i> 关于我们</dt>
<dt><i class="fa fa-map-marker"></i> 办公室地图</dt>
<dd> <i class="fa fa-bank"></i> 办公室地图 </dd>
<dt><i class="fa fa-envelope"></i> 联系我们</dt>
<dd> <i class="fa fa-building"></i> 地址:北京朝阳区东三环 <br/>
<i class="fa fa-qq"></i> QQ:123456 <br/>
<i class="fa fa-weixin"></i> 微信: <br/>
</dd>
</dl>
<script type='text/javascript' src="js/jquery.js"></script>
<script>
$(function(){
$('dd').filter(':nth-child(n)').addClass('hidden');
$('dl').on('click', 'dt', function() {
$(this)
.next()
.slideDown(300)
.siblings('dd')
.slideUp(300);
});
generateFont();
});
</script>
</body>
</html>
CSS代码(gbtags.css):
/* 课程:扁平风格手风琴式菜单效果 */
body{width:450px;margin:100px auto;text-align:center;font-family:'microsoft yahei',Arial,sans-serif;background:#222222;}
h1{border-bottom:1px solid #555555;color:#fff;padding-bottom:20px;font-size:28px;font-weight:normal;margin-bottom:30px;}
dd{margin:0;padding:20px 0;font-size:14px;background:#fbfbfb;padding:10px 15px;text-align:left;}
dt{cursor:pointer;font-size:18px;line-height:23px;background:#EB852A;border-top:1px solid #EFEFEF;box-shadow:0 1px 0 #FFFFFF;font-weight:400;color:#fff;text-align:left;padding:10px 14px;}
dt:first-child{border-top:none;}
dt:nth-last-child(2){border-bottom:none;}
.hidden{display:none;}
footer{margin:50px;}
footer p{color:#dd4814;text-decoration:none;}