我有几个对话框打开如下:
$("#dialog").load("/ajax/content.php");
$("#dialog").dialog({....});
和一个全局事件监视器来动画对话框的打开
$(document).on("dialogOpen", ".dialogClass", function() {
var parent = $(this).parent();
parent.css("left","-768px");
parent.animate({
left:0
}, speed, "easeOutBounce");
}
在某些页面上,这看起来很不稳定。我怀疑这些动画是在对话框加载和呈现其 ajax 调用的结果时发生的。有什么办法可以暂停,直到所有其他动画都完成,例如:
$(document).on("dialogOpen", ".dialogClass", function() {
//Wait until other rendering is complete prior to executing further
var parent = $(this).parent();
parent.css("left","-768px");
parent.animate({
left:0
}, speed, "easeOutBounce");
}