我正在尝试这个:
var notifications = $( "#notifications" );
notifications.fadeOut("slow")
.complete(function () {
alert('completed');
});
但我得到了:未捕获的TypeError:notifications.fadeOut(...)。完成不是函数
答案 0 :(得分:3)
指定on-complete-callback有两种方法:
通过第二个参数:
var notifications = $( "#notifications" );
notifications.fadeOut("slow", function () {
alert('completed');
});
或选项:
var notifications = $( "#notifications" );
notifications.fadeOut({
duration: "slow",
complete: function () {
alert('completed');
}
});