2
有没有办法延迟ajax请求执行直到动画结束?如何在jQuery中延迟ajax调用?
var showAjaxLoader = function(selector) {
$("." + selector).fadeToggle("slow");
$("." + selector).parent().html('<img src="ajax-loader.gif" />').fadeIn();
};
$(".add, .delete")
.bind("ajax:beforeSend", function(event, data, status, xhr) {
showAjaxLoader(this.className);
});
基本上,请求的响应将取代lay内容,但我不希望这种情况发生,直到发生效果。否则图像将只是弹出,没有效果...