473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cool count down timer sourcecode bug fixed !

Hello guys, sorry for my last version has a little "feature"(MS always
call his bug "feature"), and now I fixed it and show the source to you
all ! Just as the last version, copy the code below and save in a .htm
file, fox example : "1.htm", and run it in a browser support JavaScript
1.1 or later, the cool count down timer will show you ! If it doesn't
work, you may open http://www.fillweb.com in IE, and View->Source to
see the latest version of source code !

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Welcome to Fillweb home page</title>
<meta name="keywords" content="fillweb, form filler, fill forms
automatically, account logon login, single sign on, fill web forms,
fill online forms automatically, form filling software, ai web
automatic auto fill out forms fill in forms">
<script language="JavaScript">
<!--
var timerID;
var timerRunning = false;
var today = new Date();
var startday = new Date();
var secPerDay = 0;
var minPerDay = 0;
var hourPerDay = 0;
var secsLeft = 0;
var secsRound = 0;
var secsRemain = 0;
var minLeft = 0;
var minRound = 0;
var minRemain = 0;
var timeRemain = 0;
/* This function will stop the clock */
function stopclock()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
/* This function will start the clock */
function startclock()
{
stopclock();
countdown();
}
function startclock_cn()
{
stopclock();
showtime_cn();
}
/* This function will display the count-up */
function countdown()
{
startday = new Date("November 01, 2006 00:00 GMT");
startday.setYear("2006");
today = new Date();
secsPerDay = 1000 ;
minPerDay = 60 * 1000 ;
hoursPerDay = 60 * 60 * 1000;
PerDay = 24 * 60 * 60 * 1000;
/* Seconds */
secsLeft = (startday.getTime() - today.getTime()) / minPerDay;
secsRound = Math.round(secsLeft);
secsRemain = secsLeft - secsRound;
secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound -
secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
secsRemain = Math.round(secsRemain);
/* Minutes */
minLeft = ((startday.getTime() - today.getTime()) / hoursPerDay);
minRound = Math.round(minLeft);
minRemain = minLeft - minRound;
minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) *
60) : minRemain = ((minLeft - minRound) * 60);
minRemain = Math.round(minRemain - 0.495);
/* Hours */
hoursLeft = ((startday.getTime() - today.getTime()) / PerDay);
hoursRound = Math.round(hoursLeft);
hoursRemain = hoursLeft - hoursRound;
hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound -
hoursLeft) * 24) : hoursRemain = ((hoursLeft - hoursRound) * 24);
hoursRemain = Math.round(hoursRemain - 0.5);
/* Days */
daysLeft = ((startday.getTime() - today.getTime()) / PerDay);
daysLeft = (daysLeft - 0.5);
daysRound = Math.round(daysLeft);
daysRemain = daysRound;
/* Time */
if (daysRemain < 2)
{
day_rem = " day, "
}
else
{
day_rem = " days, "
}
if (hoursRemain < 2)
{
hour_rem = " hour, "
}
else
{
hour_rem = " hours, "
}
if (minRemain < 2)
{
min_rem = " minute, "
}
else
{
min_rem = " minutes, "
}
if (secsRemain < 2)
{
sec_rem = " second"
}
else
{
sec_rem = " seconds"
}
timeRemain = "Fillweb is coming in " + daysRemain + day_rem +
hoursRemain + hour_rem + minRemain +
min_rem + secsRemain + sec_rem;
document.counter.face.value = timeRemain;
timerID = setTimeout("countdown()",1000);
timerRunning = true;
}
//-->
</script>
</head>
<body onLoad="startclock()" bgcolor="#000000">
<div align="center">
<table border="0" width="700" height="333" cellspacing="2">
<tr>
<td background="images/milkyway.jpg"></td>
</tr>
<tr>
<td align="center" height="18" valign="bottom">
<form name="counter" style="position: relative">
<input type="text" name="face" size="100" value="A browser supporting
JavaScript 1.1+ is needed." style="border:1px solid #000000;
background-color:#000000; font-size:9pt; color:#FFFFFF;
text-align:center; position:relative; ">
</form>
</td>
</tr>
</table>
</div>
<script src="http://www.google-analytics.com/urchin.js"
type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-859503-1";
urchinTracker();
</script>
</body>
</html>

Oct 31 '06 #1
1 1898
He********@gmail.com said the following on 10/31/2006 2:24 AM:
Hello guys, sorry for my last version has a little "feature"(MS always
call his bug "feature"), and now I fixed it and show the source to you
all ! Just as the last version, copy the code below and save in a .htm
file, fox example : "1.htm", and run it in a browser support JavaScript
1.1 or later, the cool count down timer will show you !
And then find one that is actually worth having.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HeroinNO.4 | last post by:
Copy the code below and save in a .htm file, for example : 1.htm, then run it in browser, you'll see a cool count down timer ! If it doesn't work, you may open http://www.fillweb.com in IE and...
2
by: HeroinNO.4 | last post by:
Hello guys, now the source code updated to November 06, 2006 00:00 GMT,and now I fixed it and show the source to you all ! Just as the last version, copy the code below and save in a .htm file, fox...
7
by: HeroinNO.4 | last post by:
Hello guys, free count down timer source code has updated to 06/11/27, you can copy the code below and save in a ".htm" file and run it in a browser support javascript 1.1 or later, or you can open...
3
missshaikh
by: missshaikh | last post by:
Hi all, i need the count down timer when button click the timer start and count down work on ASP.net :( i have one timer which is on JavaScript that run page onload . but i need the Button...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.