1
我有一個函數,當運行時,在我的頁面上動畫一個div並刪除一個類,然而我想要做的是在高度動畫結束時刪除類,這可能與jQuery?命令jquery函數在另一個函數完成後發生
var el = $(this).find('ul li');
var img = $(this).find('ul li img');
$(this).removeClass('active');
//return false;
el.animate({height:'135px'}, 500);
el.css({
'background-position':'top left',
'background-size' : 'auto auto'
});
$(this).find('ul li img').animate({height:'270px'}, 500);
$(this).animate({height:'135px'}, 500);
img.attr('src', function(i, value) {
return value.substring(28);
});
使用動畫回調函數,設置你的邏輯有 –