Countdown test

and using original code (40 character input) without table


Code:
<Script language='Javascript'>
<!--
//Countdown Timer v2.0
//Written by: James M. Venglarik, II
//Created on: March 28, 2002
var rndNum = Math.floor(Math.random() * 10000);
eval("var CDTDate" + rndNum + " = 'april 30,2004 1:00:00 AM EST';");
document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");
document.writeln('<font size=2 color=darkblue>dddd</font><br>');
document.writeln("<input type=text value='' size=40 name='countdown'>");
document.writeln("</form>");
if (theFunction) 
theFunction += "var d = new Date();";
else 
var theFunction = "var d = new Date();";
theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";
theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";
theFunction += "var diff = ((c - d)/1000) + tzo;";
theFunction += "var days = Math.floor(diff / 86400);";
theFunction += "var rem = diff - (days * 86400);";
theFunction += "var hours = Math.floor(rem / 3600);";
theFunction += "rem = rem - (hours * 3600);";
theFunction += "var minutes = Math.floor(rem / 60);";
theFunction += "rem = rem - (minutes * 60);";
theFunction += "var seconds = Math.floor(rem);";
theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";
theFunction += "var out = 'ffffff';";
theFunction += "else ";
theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";
theFunction += "document.forms.CDTform" + rndNum + ".elements.countdown.value = out;";
setInterval(theFunction, 1000);
//-->
</Script>
 
and using original code (40 character input) with table at 80%


<table width='80%'><TR><TD>
Code:
<Script language='Javascript'>
<!--
//Countdown Timer v2.0
//Written by: James M. Venglarik, II
//Created on: March 28, 2002
var rndNum = Math.floor(Math.random() * 10000);
eval("var CDTDate" + rndNum + " = 'april 30,2004 1:00:00 AM EST';");
document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");
document.writeln('<font size=2 color=darkblue>dddd</font><br>');
document.writeln("<input type=text value='' size=40 name='countdown'>");
document.writeln("</form>");
if (theFunction) 
theFunction += "var d = new Date();";
else 
var theFunction = "var d = new Date();";
theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";
theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";
theFunction += "var diff = ((c - d)/1000) + tzo;";
theFunction += "var days = Math.floor(diff / 86400);";
theFunction += "var rem = diff - (days * 86400);";
theFunction += "var hours = Math.floor(rem / 3600);";
theFunction += "rem = rem - (hours * 3600);";
theFunction += "var minutes = Math.floor(rem / 60);";
theFunction += "rem = rem - (minutes * 60);";
theFunction += "var seconds = Math.floor(rem);";
theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";
theFunction += "var out = 'ffffff';";
theFunction += "else ";
theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";
theFunction += "document.forms.CDTform" + rndNum + ".elements.countdown.value = out;";
setInterval(theFunction, 1000);
//-->
</Script>
</TD></TR></TABLE>
 
and using original code (40 character input) with table at 100%

Any more variations you need to see?


<table width='100%'><TR><TD>
Code:
<Script language='Javascript'>
<!--
//Countdown Timer v2.0
//Written by: James M. Venglarik, II
//Created on: March 28, 2002
var rndNum = Math.floor(Math.random() * 10000);
eval("var CDTDate" + rndNum + " = 'april 30,2004 1:00:00 AM EST';");
document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");
document.writeln('<font size=2 color=darkblue>dddd</font><br>');
document.writeln("<input type=text value='' size=40 name='countdown'>");
document.writeln("</form>");
if (theFunction) 
theFunction += "var d = new Date();";
else 
var theFunction = "var d = new Date();";
theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";
theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";
theFunction += "var diff = ((c - d)/1000) + tzo;";
theFunction += "var days = Math.floor(diff / 86400);";
theFunction += "var rem = diff - (days * 86400);";
theFunction += "var hours = Math.floor(rem / 3600);";
theFunction += "rem = rem - (hours * 3600);";
theFunction += "var minutes = Math.floor(rem / 60);";
theFunction += "rem = rem - (minutes * 60);";
theFunction += "var seconds = Math.floor(rem);";
theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";
theFunction += "var out = 'ffffff';";
theFunction += "else ";
theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";
theFunction += "document.forms.CDTform" + rndNum + ".elements.countdown.value = out;";
setInterval(theFunction, 1000);
//-->
</Script>
</TD></TR></TABLE>
 


1024x768

Going smaller tends to have me horizontally scroll more on countdown threads.

I just don't know what the others are seeing here as I do not have NS installed at this time.
 
Without the CODE tag example


<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'May 2, 2003 1:00:00 AM EST';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>abcd</font><BR>');document.writeln("<input type=text value='' size=40 name='countdown'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();"; else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0))";theFunction += "var out = 'xyz';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.countdown.value = out;";setInterval(theFunction, 1000);</Script>
 


SAB: Good Job! I forgot that the only thing the board does to the script is insert the <br> tag at each line break (it also does funky things with the curly-brace character so that's why I couldn't use it). I'll check with JC about changing the Countdown Timer Generator to incorporate your solution.

Thanks!
- Jim
 
Testing...
<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'May 11, 2002 1:00:00 PM EDT';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>I\'m Testing:</font><br>');document.writeln("<input type=text value='' size=40 name='countdown'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = 'Havin\\\' fun in the sun!!!';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.countdown.value = out;";setInterval(theFunction, 1000);</Script>
 
Once more - from the generator directly:

<Script language='Javascript'>var rndNum = Math.floor(Math.random() * 10000);eval("var CDTDate" + rndNum + " = 'March 11, 2002 1:00:00 PM EDT';");document.writeln("<form name='CDTform" + rndNum + "' action='Javascript:void(0);'>");document.writeln('<font size=2 color=darkblue>I\'m Testing :Pinkbounc :bounce:</font><br>');document.writeln("<input type=text value='' size=40 name='countdown'>");document.writeln("</form>");if (theFunction) theFunction += "var d = new Date();";else var theFunction = "var d = new Date();";theFunction += "var c = new Date('" + eval("CDTDate" + rndNum) + "');";theFunction += "var tzo = (c.getTimezoneOffset() - d.getTimezoneOffset()) * 60;";theFunction += "var diff = ((c - d)/1000) + tzo;";theFunction += "var days = Math.floor(diff / 86400);";theFunction += "var rem = diff - (days * 86400);";theFunction += "var hours = Math.floor(rem / 3600);";theFunction += "rem = rem - (hours * 3600);";theFunction += "var minutes = Math.floor(rem / 60);";theFunction += "rem = rem - (minutes * 60);";theFunction += "var seconds = Math.floor(rem);";theFunction += "if ((days < 0) | (hours < 0) | (minutes < 0) | (seconds < 0)) ";theFunction += "var out = 'I\\\'m Testing this, too!';";theFunction += "else ";theFunction += "var out = ' ' + days + ' days ' + hours + ' hrs. ' + minutes + ' mins. ' + seconds + ' secs.';";theFunction += "document.forms.CDTform" + rndNum + ".elements.countdown.value = out;";setInterval(theFunction, 1000);</Script>
 

GET A DISNEY VACATION QUOTE

Dreams Unlimited Travel is committed to providing you with the very best vacation planning experience possible. Our Vacation Planners are experts and will share their honest advice to help you have a magical vacation.

Let us help you with your next Disney Vacation!











facebook twitter
Top