[英]Show bootstrap modal dialog background, before dialog loads?
I am loading content into a bootstrap modal dialog via jquery. 我正在通过jquery将内容加载到引导模式对话框中。 (I am using bootbox addon for dynamic modal dialog creation)
(我正在使用bootbox插件来创建动态模式对话框)
$.ajax({
url: "create.cshtml",
dataType: 'html',
success: function (data, textStatus, jqXHR)
{
bootbox.dialog(data);
},
error: function (jqXHR, textStatus, errorThrown)
{
HandleError(textStatus, errorThrown);
}
});
Now this all works fine. 现在一切正常。
But what I want to do is show the fade in background while I wait for the aync call to complete so the user can see it's loading. 但是我想做的是在等待aync调用完成时显示背景渐变,以便用户可以看到它正在加载。 I can't see anything in the docs about showing the modal background but I presume there must be a way to trigger it before I perform the async call.
我在文档中看不到任何有关显示模态背景的信息,但我认为在执行异步调用之前必须有一种触发它的方法。
Anyone have any ideas? 有人有想法么?
You could do this: 您可以这样做:
$("YOUR_BACKGROUND").fadeIn("slow", function(){
//MAKE YOUR AJAX CALL HERE
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.