我想在动画完成后删除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();
});
})
});
答案 0 :(得分:0)
试试这个
$('#btnGo').click(function () {
var $ulCust = $('#divCust ul');
$ulCust.find('li:first').animate({
opacity: 0.25,
left: 915
complete: function () {
$('#btnGo').html('Complete');
}
});
});