JQuery Animate函数实现透明度和位置渐变的实例

求JQuery Animate函数实现透明度和位置渐变的实例

2010-06-12 11:04 花开花落花无意 分类:JavaScript | 浏览 3967 次
要html代码和脚本代码都有..

然后实现一张图片渐渐透明并向上移动的效果..

谁能帮帮忙吗谢谢了..

<html>
<head>
<title>Untitled</title>

</head>

<body>
<div id="d" style="margin-top:200px;width:100px;height:100px;background-color:red"></div>
</body>
<script type="text/javascript" src="jquery_min.js"></script>
<script type="text/javascript">
$(function (){
$("#d").animate({opacity:"0",marginTop:"0"},6000);
});
</script>
</html>
.category{ width:334px; height:334px; background:url(../images/cate_pic.jpg) no-repeat; float:left; position:relative;}
.news .nr .title,.category .nr .title{background:url(../images/whit_line.gif) left bottom no-repeat; color:#FFFFFF;}

.news .nr,.category .nr{ width:100%; height:100%; position:absolute; z-index:1; top:0; background:#035fad;filter:alpha(Opacity=0);-moz-opacity:0;opacity: 0;}
.news .nr ul,.category .nr ul{ padding-left:30px; }
.news .nr a,.category .nr a{ color:#FFFFFF;padding-left:15px; background:url(../images/icon.png) left center no-repeat; line-height:35px; height:35px;}
.news .nr a:hover,.category .nr a:hover{ color:#DEF664;background:url(../images/hover_icon.png) left center no-repeat;}

.category .title,.yanfa .title,.news .title{ background:url(../images/block_line.gif) no-repeat left bottom; height:56px; line-height:56px; margin:0px 0px 18px 20px; padding-top:20px;}
.category .title h3,.yanfa .title h3,.news .title h3{ font-size:20px; line-height:20px; padding-top:10px;}
.category .title p,.yanfa .title p,.news .title p{ font-size:12px; line-height:20px;} 



<div class="category">
        <div class="title"><h3>产品分类</h3><p>Product category</p></div>
<div class="nr">
<div class="title"><h3>产品分类</h3><p>Product category</p></div>
<ul>
<li><a href="#">分类名称</a></li>
<li><a href="#">分类名称</a></li>
<li><a href="#">分类名称</a></li>
<li><a href="#">分类名称</a></li> 
<li><a href="#">分类名称</a></li> 
<li><a href="#">分类名称名称</a></li> 
            </ul>
</div>
        </div>
$(".category").hover(function(){
$(this).find(".nr").animate({opacity:"0.85"},1000);
},
function(){
$(this).find(".nr").animate({opacity:"0"},500);
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

北方的刀郎

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值