<!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渐变下拉菜单效果_www.jb200.com</title>
<style type="text/css">
a{text-decoration:none;color:#333;}
a:hover{color:#f33;}
a.gr{color:#227CE8;}
a.xg{color:#f30;}
a.zx{color:#690;}
a.yd{color:#f00;}
a.more-rss{color:#f60;}
a img{border:none;}
a.rssfeed{display:block;height:60px;width:160px;cursor:pointer;}
.wrapper{width:700px;margin:0 auto;height:460px;position:relative;}
.wrapper small{position:absolute;bottom:0;left:0;border-top:1px dotted #b3b3b3;display:block;width:700px;
line-height:30px;text-align:right;}
ul li{list-style:none;}
ul li.dropdown{position:relative;width:160px;}
ul li.dropdown ul{display:none;text-align:center;background:#fff;border:1px solid #ddd;width:160px;padding:15px 15px 20px;}
ul li.dropdown ul li{padding:5px 0;border-bottom:1px dotted #ddd;}
</style>
</head>
<body>
<div class="wrapper">
<h1><a href="">jQuery 渐变下拉菜单</a></h1>
<p>使用slideToggle和slideUp来实现.当然,也可以使用hide/show, fadeIn/fadeOut等来实现,只是效果不同,实现方法一样。注意:要为.dropdown加上position:relative;防止闪烁.</p>
<ul class="fir">
<li class="dropdown">
<a class="rssfeed"><img src="feedme.png" alt="feedme" /></a>
<ul>
<li><a href="#" rel="RSS"><img src="rss.gif" alt="RSS Feed" /></a></li>
<li><a href="#" class="xg" rel="nofollow">鲜果订阅</a></li>
<li><a href="#" class="gr" rel="nofollow">Google订阅</a></li>
<li><a href="#" class="zx" rel="nofollow">抓虾订阅</a></li>
<li><a href="#" class="yd" rel="nofollow">有道订阅</a></li>
<li><a href="#" class="more-rss" rel="RSS">更多方式 ?</a></li>
</ul>
</li>
</ul>
</div>
<script language="
javascript" type="text/javascript" src="jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(function(){
$(".fir .dropdown").hover(
function(){
$("li ul").slideToggle(800);
},function(){
$("li ul").slideUp(1000)
})
})
</script>
</body>
</html>