Click to See Complete Forum and Search --> : countdown script
davey
12-03-2003, 09:08 PM
i need a count down script to run
function do_totals1(){
document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout('timer1()',1);}
i want it to run for like 5 or 10 seconds any help is appreciated
Pittimann
12-04-2003, 12:02 AM
Hi!
You can try something like that:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
var secondsToWait=5;//change to no of seconds you like
function do_totals1(){
timeSet=window.setTimeout('timer1()',secondsToWait*1000);
}
function timer1(){
alert("Waited long enough");
}
//-->
</script>
</head>
<body onload="do_totals1()">
</body>
</html>
Cheers - Pit
davey
12-04-2003, 08:22 PM
well
this is what it should look like i think
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!--
var secondsToWait=5;
function do_totals1(){
document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout('do_totals2()',secondstowait*1000);}
function do_totals2(){
lengthy_calculation();
document.all.pleasewaitScreen.style.visibility="hidden";}
function lengthy_calculation()
alert("You are done");}
//-->
</script>
</head>
<body>
<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">
<input type="button" name="btn_calc" value="Perform Calculation" onclick="do_totals1()">
</p>
</body>
</html>
but it doesnt seem to work
Pittimann
12-05-2003, 01:05 AM
Hi!
Mine was just to show you the usage of the setTimeout.
Your's has a few small typos. Try something like that:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
<!--
var secondsToWait=5;
function do_totals1(){
document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50);
document.all.pleasewaitScreen.style.visibility="visible";
window.setTimeout('do_totals2()',secondsToWait*1000);}
function do_totals2(){
lengthy_calculation();
document.all.pleasewaitScreen.style.visibility="hidden";}
function lengthy_calculation() {
alert("You are done");}
//-->
</script>
</head>
<body>
<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">
<input type="button" name="btn_calc" value="Perform Calculation" onclick="do_totals1()">
</p>
</body>
</html>
Cheers - Pit
levp92
08-18-2005, 10:08 AM
I need a countdown clock (only days) to 20 june 2006... BUT!!! i need one that don't count saturday and few holydays... Please anyone can hrlp me?