0

我使用没有对话框 ui 的对话框在网页中显示错误事件

<div id="downloadcredit" style="width:100%;position:fixed;height:100%;min-height:overflow:hidden;background-color:rgba(127,127,127,0.4);display:none;" >
<div style="text-align:right;width:466px;position:absolute;left:0;right:0;height:337px;min-height:overflow:hidden;background:url(images/creditbase.png);color:black;margin-left:auto;margin-right:auto;top:200px;font:16px behzad;">
<div style="width:100%;height:40px;background:transparent;font:20px behzad;padding-top:8px;color:#818181;text-align:center;"><span style="float:right;font:12px tahoma;font-weight:bold;color:#75797A;margin-right:15px;cursor:pointer;margin-top:6px;" onclick="$('#downloadcredit').slideUp('slow');">X</span></div>
<div style="margin:175px auto 10px;width:95%;font:11px tahoma;text-align:center;color:white;line-height:165%;">

<p> Erorr Sample ...
</div>
</div>
</div>
<body onload="$('#downloadcredit').slideDown('1000');">

但我的页面加载缓慢,页面加载完成后 3 或 4 秒后显示对话框:(。有什么方法可以先显示对话框并在后台加载页面?

4

1 回答 1

1

我通常将样式“display:none”应用于目标容器,然后您可以使用 .load() 函数并使用回调来显示填充数据的容器。

基本上 :

$('#target').hide();
$('#target').addClass("loading-layer");
$('#target').load('toto.php',function(){
    $('#target').removeClass("loading-layer");
    $('#target').show();
});
于 2012-11-25T17:49:56.067 回答