想知道是否有一种方法可以在没有所有冗余代码的情况下更改此动画的左侧 css 值?
$('.recent .view-details-wrapp').css({opacity:0, left:33});
$('.recent .controls-wrapp').hover(function() {
$(this).find('.view-details-wrapp').stop()
.animate({left:63}, {queue:false, duration:300, easing:'easeOutCubic'})
.animate({opacity:'0.99'}, {queue:false, duration:400, easing:'easeOutCubic'});
},function() {
$(this).find('.view-details-wrapp').stop()
.animate({left:33}, {queue:false, duration:550, easing:'easeOutSine'})
.animate({opacity:'0'}, {queue:false, duration:300, easing:'easeOutSine'});
});
$('.featured .view-details-wrapp').css({opacity:0, left:83});
$('.featured .controls-wrapp').hover(function() {
$(this).find('.view-details-wrapp').stop()
.animate({left:103}, {queue:false, duration:300, easing:'easeOutCubic'})
.animate({opacity:'0.99'}, {queue:false, duration:400, easing:'easeOutCubic'});
},function() {
$(this).find('.view-details-wrapp').stop()
.animate({left:83}, {queue:false, duration:550, easing:'easeOutSine'})
.animate({opacity:'0'}, {queue:false, duration:300, easing:'easeOutSine'});
});