我试图在鼠标悬停时为图像设置动画,我希望它在不使用鼠标悬停的情况下动画回到正常位置。
$(document).ready(function() {
$("#bysti-menu li").mouseover(function(){
var $elem = $(this);
$elem.find('.uprmenuicon')
.animate({
'margin-top':'-40px'
},400,'easeOutBack').animate({
'margin-top':'0px'
},400,'easeOutBack')
}).mouseout(function(){
// do nothing
});
});
在这里,当我将鼠标悬停在图像上时,它的边距变为-40px,但我希望在那之后它立即变为0px,即使鼠标还没有出来?任何人都可以帮助我吗?