Creating a counting timer in Javascript / JQuery

Hey, I'm just wondering if someone can tell me or point me in the right direction on how to make a counting timer.

I would like to have it constantly, from the second I put it in place, counting seconds, minutes, hours, days and years.

Thank!

+2


source to share


3 answers


http://www.dailycoding.com/Posts/object_oriented_programming_with_javascript__timer_class.aspx



I have used this and it works great. The example used is counting, but I also used it to count.

+3


source


Here is a Javascript counter timer I wrote. It takes a timestamp to start timing, an ID to place the timer, and a message to add to the timer. Please find the link of the demo page at the bottom of the post (cannot provide a link here). The demo page has two types of counters.



+4


source


<script language="JavaScript">
TargetDate = "12/31/2020 5:00 AM";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = 1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script>

      

0


source







All Articles