首页 > 代码库 > jquery下移和淡进同时进行

jquery下移和淡进同时进行

<!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>无标题文档</title>
<style>
p{ display:list-item;}
.aa{ width:100%; height:50px; position:relative; background:#69F;}
.bb{ width:800px; margin:auto; height:50px; position:relative;}
.cc{ width:60px; height:83px; background:url(images/w_1.png) center no-repeat; position:absolute; top:50px; cursor:pointer;}
.cc:hover{ background-position:0px -29px; z-index:9999;}
.dd{ width:200px; height:300px; background:#033;position:absolute; z-index:99; margin-left:10px; opacity:0;}
</style>
<script type="text/javascript" src="http://www.mamicode.com/js/jquery-1.7.1.min.js"></script>
<script>



$(function(){
$(".cc").mouseover(function(){
$(".dd").animate({ top:50,opacity:1 },500);
})

$(".cc").mouseout(function(){
$(".dd").animate({ top:0,opacity:0 },500);
})

})
</script>
</head>

<body>
<div class="aa">
<div class="bb">
<div class="cc"></div>
<div class="dd"></div>
</div>
</div>
</body>
</html>

jquery下移和淡进同时进行