您好,我正在尝试将以下 css3 动画转换为 jquery,但运气不佳:
.portfoliobox .rollover
{
height: 220px;
width: 100%;
background: url(../img/rolloverbg.png);
margin-top: 220px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
overflow: hidden;
}
.portfoliobox:hover .rollover
{
float: left;
margin-top: 100px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
overflow: hidden;
}
效果可以看这里:http ://www.astwood.co.uk/testsite/wordpress/
有人可以帮帮我吗?
编辑:我已经尝试过的代码
$(document).ready(function(){
$('.portfoliobox').hover(function(){
$(".rollover", this).stop().animate({margin-top:'220px'},{queue:false,duration:160});
}, function() {
$(".rollover", this).stop().animate({margin-top:'100px'},{queue:false,duration:160});
});
});