0

Webページでエラーイベントを表示するために、ダイアログ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 に答える