2012-11-25 144 views
0

我使用对话框,不作秀erorr事件对话框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秒。 任何方式显示对话框的第一个和页面加载在后台?

+0

能不能请你把 –

+0

http://jsfiddle.net/V6JTa/的代码。请给我样品。 –

回答

1

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

基本上:

$('#target').hide(); 
$('#target').addClass("loading-layer"); 
$('#target').load('toto.php',function(){ 
    $('#target').removeClass("loading-layer"); 
    $('#target').show(); 
}); 
+0

升不知道l可如何使用此代码对http://jsfiddle.net/ –

+0

请给我一个样品。 –