我正在建立一个网站。在网站上,当我将数据发布到服务器时,我会显示一个fancybox作为下面的代码。
function showfancybox()
{
$.fancybox($('#popup-processing-senddata'), {
padding: 0,
closeBtn: false,
helpers: {
overlay:
{
opacity: 0.8,
css: { 'background-color': '#11619d' },
closeClick: false
}
}
});
SendDataToServer = function () {
if (this.enableNextButton()) {
showfancybox();
var hasError = false;
for (var i = 0; i < this.Rows().length; i++)
{
$.ajax({
async:false,
type: "POST",
url: "/AddCustomer/SendData",
contentType: "application/json; charset=utf-8",
dataType: "JSON",
data: JSON.stringify(rowData),
success: function (datareturn)
{
if (datareturn != '') {
$.fancybox.close();
showCustomError(datareturn);
hasError = true;
}
},
error: function (xhr, status, error) {
// Boil the ASP.NET AJAX error down to JSON.
var err = eval("(" + xhr.responseText + ")");
// Display the specific error raised by the server (e.g. not a
// valid value for Int32, or attempted to divide by zero).
$.fancybox.close();
showCustomError(err);
hasError = true;
}
});
}
}
我正面临着一个问题。当提交数据时,fancybox只显示一个叠加层,fancybox的内容延迟15秒。我需要fancybox的内容延迟不到2秒。任何人都可以帮助我吗? 谢谢inadvance