我想在动画完成后删除 ul 的 li,但是 它使 li 在完成之前删除。请帮我解决这个问题
$('#btnGo').click(function() {
var $ulCust = $('#divCust ul');
$ulCust.find('li:first').animate({
opacity: 0.25,
left: 915
}, 'slow', function() {
//this function executes before animation completes
$('#btnGo').delay(2000).html('Complete'); //this delay is also not working
console.log('complete');
//$(this).delay(100000).remove();
});
})
});
最佳答案
试试这个
$('#btnGo').click(function () {
var $ulCust = $('#divCust ul');
$ulCust.find('li:first').animate({
opacity: 0.25,
left: 915
complete: function () {
$('#btnGo').html('Complete');
}
});
});
关于javascript - jquery animate Complete 函数在动画完成之前执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31469182/