精美平滑向下二级菜单js效果(转)

这是一款jQurey实现的向下二级导航菜单效果。效果非常不错,由上到下平滑延伸,给人的感觉协调唯美!js与html代码结构简单明了,便于使用与修改!

 

<!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实现精美二级菜单——js特效大全-www.tonjay.com/js</title>
<style type="text/css">
*
{ margin:0; padding:0; }
body
{ font:12px/normal Arial, Helvetica, sans-serif; }
ul, ol
{ list-style:none; }
a img
{ border:none; }
#content
{ width:800px; margin:30px auto; }
.main_nav
{ width:100%; height:30px; }
.main_nav ul li
{ float:left; width:190px; height:30px; border-right:1px solid #666; position:relative; }
.main_nav ul li a
{ display:block; height:30px; line-height:30px; text-align:center; background:#333; color:#ccc; text-decoration:none; }
.main_nav ul li dl
{ position:absolute; left:0; top:30px; width:190px; display:none; }
.main_nav ul li dl dd
{ height:31px; }
.main_nav ul li dl dd a
{ display:block; height:30px; line-height:30px; text-align:center; color:white; background:#555; border-bottom:1px solid #666; }
.main_nav ul li dl dd a:hover
{ background:#333; color:#ccc; }
.click
{ margin-top:200px; }
</style>
</head>
<body>
<div id="content">
<div class="main_nav hover">
<ul>
<li><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页特效</a>
<dl>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页特效</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页特效</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页特效</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页特效 </a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页特效</a></dd>
</dl>
</li>
<li><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计</a>
<dl>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计 </a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计 </a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页设计 </a></dd>
</dl>
</li>
<li><a href="http://www.tonjay.com" title="">网页制作</a>
<dl>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页制作</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页制作</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页制作</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页制作 </a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网页制作</a></dd>
</dl>
</li>
<li><a href="#" title="">网站优化</a>
<dl>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网站优化</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网站优化</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网站优化</a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网站优化 </a></dd>
<dd><a href="http://www.tonjay.com" title="js特效大全-www.tonjay.com/js">网站优化</a></dd>
</dl>
</li>
</ul>
</div>
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
$(
".hover ul li").hover(function(){
$(
this).children("dl").slideDown(300)
},
function(){
$(
this).children("dl").slideUp(100)
});
</script>
<div style="width:960px; margin:0 auto;">
<script type="text/javascript">/*Js—AD*/ var cpro_id = 'u360072';</script><script src="http://cpro.baidu.com/cpro/ui/c.js" type="text/javascript"></script></div>
</body>
</html>

 

 

posted @ 2012-04-07 10:52  沧海小强  阅读(534)  评论(0编辑  收藏  举报