Current location: Hot Scripts Forums » General Web Coding » JavaScript » countdown timer


countdown timer

Reply
  #1 (permalink)  
Old 03-18-05, 01:44 PM
misterman misterman is offline
Newbie Coder
 
Join Date: Jun 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
countdown timer

I'm gonna need a timer that counts down for 15 mins.

Example:

it's 10:15 am the timer start counting down to 10:30. Then after that it should start over and counting from 10:30 to 10:45 and so on. but it should not restart counting at a restart.

Could somebody help me??? I really appreciate it.
Reply With Quote
  #2 (permalink)  
Old 03-22-05, 01:35 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
I'll give you a few tips to start with, but I could write the whole script if you want.

Use a cookie to store the current date. Use setInterval to update a function which counts down from that date. You should probabaly store the date in milliseconds since it's easier to read a bunch of numbers from the cookie and convert them back to a date. (I think there's a build in method for the conversion)

If the visitor leaves you want the counter to continue form the stored date. So the first thing the script should do is to check the cookie file to see if there's a date in there.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OOP Countdown Script PhoenixFire JavaScript 2 02-01-05 02:40 PM
Need a countdown clock Tocpe Script Requests 1 10-17-04 08:38 AM
SendKey command & Timer bxcheats Visual Basic 0 08-17-04 07:51 PM
Timer Marwan Windows .NET Programming 2 05-11-04 04:00 PM
Day elapsed countdown. Jaeboy PHP 1 11-19-03 09:23 AM


All times are GMT -5. The time now is 10:43 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.