الله يعطيك العافية أولا أخي على تعبك
ثانيا بالنسبة للسكربت الثاني سأرفق لك مثال
المثال هذا وظيفته لما تضغط على الزر يطلعلك layer مكتوب فيها Please Wait
لكن المشكلة أن الصفحة تتجمد فترة ثم تعود للعمل بعد اختفاء الـ Layer
المطلوب نفس عمل السكربت لكن دون تجمد الصفحة
--------------------المثال---------------
<script language="javascript">
function do_totals1()
{
document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="vi sible";
window.setTimeout('do_totals2()',1);
}
function do_totals2()
{
lengthy_calculation();
document.all.pleasewaitScreen.style.visibility="hi dden";
}
function lengthy_calculation()
{
var x,y
for(x=0;x<1000000;x++)
{
y += (x * y) / (y - x);
}
}
</script>
<DIV ID="pleasewaitScreen" STYLE="position:absolute;z-index:5;top:30%;left:42%;visibility:hidden">
<TABLE BGCOLOR="#000000" BORDER="1" BORDERCOLOR="#000000" CELLPADDING="0" CELLSPACING="0" HEIGHT="100" WIDTH="150" ID="Table1">
<TR>
<TD WIDTH="100%" HEIGHT="100%" BGCOLOR="silver" ALIGN="CENTER" VALIGN="MIDDLE">
<FONT FACE="Arial" SIZE="4" COLOR="blue"><B>Calculating<br>
Please Wait</B></FONT>
</TD>
</TR>
</TABLE>
</DIV>
<P align="center">
"Please Wait" messages are an excellent way to let the user know that your web
based application is performing some action, such as loading a page or
processing data. Without such a notification, users may begin clicking other
controls on the web page, or close the browser due to the excessive delays.
</P>
<p align="center">
Pressing the button below will simulate a lengthy function or calculation.
While the function is calculating, a "Please Wait" message will be displayed.
This is done using a DIV area. When the function begins the DIV area is shown
and when the function ends, the DIV area is hidden.
</p>
</p>
<p align="center">
<input type="button" name="btn_calc" value="Perform Calculation" onclick="do_totals1()">
</p>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
------------------------------------------
|